Documentation
¶
Overview ¶
ConfigCost is a FOCUS-shaped cost line item attached to a config item, and ConfigCostCompact is the same row after it has aged out of the hot table. ConfigCostSummary is the read-only trailing-window aggregate the catalog views join.
Index ¶
- Constants
- Variables
- func ChangeFingerprintCacheKey(configID, fingerprint string) string
- func ConvertRowToNativeTypes(row map[string]any, columnDef map[string]ColumnType) (map[string]any, map[string]string)
- func DedupConfigChanges(window time.Duration, changes []*ConfigChange) ([]*ConfigChange, []ConfigChangeUpdate)
- func DeleteAllCanaries(db *gorm.DB, canaries ...Canary) error
- func DeleteAllComponents(db *gorm.DB, components ...Component) error
- func DeleteAllConfigs(db *gorm.DB, configs ...ConfigItem) error
- func DeleteAllIncidents(db *gorm.DB, incidents ...Incident) error
- func DeleteCheckComponentRelationshipsForCanary(db *gorm.DB, id string) error
- func DeleteChecksForCanary(db *gorm.DB, id string) ([]string, error)
- func DeleteComponentChildren(db *gorm.DB, componentID string) error
- func DeleteComponentsWithIDs(db *gorm.DB, compIDs []string) error
- func DeleteInlineCanariesForComponent(db *gorm.DB, componentID string) error
- func ErrorContext(items ...Contextable) []any
- func EventQueueUniqueConstraint() []clause.Column
- func GenerateFallbackAttempt(db *gorm.DB, notification Notification, history NotificationSendHistory) error
- func GetIDs[T DBTable](items ...T) []string
- func InitChangeFingerprintCache(db *gorm.DB, window time.Duration) error
- func Now() clause.Expr
- func SetProperties(db *gorm.DB, props []AppProperty) error
- func SetPropertiesInDBFromFile(db *gorm.DB, filename string) error
- func TrimLabels(whitelist string, labels map[string]string) map[string]string
- type ABACAttribute
- type AccessReview
- type AccessToken
- type Agent
- type AnalysisType
- type AppProperty
- type Application
- type Artifact
- func (a Artifact) Columns() []api.ColumnDef
- func (a Artifact) GetContent() ([]byte, error)
- func (t Artifact) GetUnpushed(db *gorm.DB) ([]DBTable, error)
- func (a Artifact) IsInline() bool
- func (a Artifact) PK() string
- func (a Artifact) Pretty() api.Text
- func (a Artifact) Row() map[string]any
- func (a Artifact) RowDetail() api.Textable
- func (a *Artifact) SetContent(data []byte, compressionType string, maxSize int) error
- func (a Artifact) TableName() string
- type Canary
- func (c Canary) AsMap(removeFields ...string) map[string]any
- func (t Canary) ConflictClause() clause.OnConflict
- func (c Canary) GetAgentID() string
- func (c Canary) GetCheckID(checkName string) string
- func (c Canary) GetFieldsMatcher() fields.Fields
- func (c Canary) GetHealth() (string, error)
- func (c Canary) GetID() string
- func (c Canary) GetLabelsMatcher() labels.Labels
- func (c Canary) GetName() string
- func (c Canary) GetNamespace() string
- func (c Canary) GetStatus() (string, error)
- func (c Canary) GetType() string
- func (t Canary) GetUnpushed(db *gorm.DB) ([]DBTable, error)
- func (c Canary) PK() string
- func (c Canary) QueryLogSummary() string
- func (c Canary) TableName() string
- type CatalogChange
- func (c CatalogChange) AsMap(removeFields ...string) map[string]any
- func (c CatalogChange) GetID() string
- func (c CatalogChange) GetName() string
- func (c CatalogChange) GetNamespace() string
- func (c CatalogChange) GetType() string
- func (c CatalogChange) PK() string
- func (c CatalogChange) TableName() string
- type Check
- func (c Check) AsMap(removeFields ...string) map[string]any
- func (check Check) Clone() Check
- func (c Check) GetAgentID() string
- func (c Check) GetDescription() string
- func (c Check) GetFieldsMatcher() fields.Fields
- func (c Check) GetHealth() (string, error)
- func (c Check) GetHealthDescription() string
- func (c Check) GetID() string
- func (t Check) GetLabels() map[string]string
- func (c Check) GetLabelsMatcher() labels.Labels
- func (c Check) GetName() string
- func (c Check) GetNamespace() string
- func (c Check) GetStatus() (string, error)
- func (t Check) GetTrimmedLabels() []Label
- func (c Check) GetType() string
- func (t Check) GetUnpushed(db *gorm.DB) ([]DBTable, error)
- func (c Check) PK() string
- func (t Check) PKCols() []clause.Column
- func (c Check) Pretty() api.Text
- func (c Check) PrettyRow(opts interface{}) map[string]api.Text
- func (c Check) QueryLogSummary() string
- func (c Check) TableName() string
- func (c Check) ToString() string
- func (t Check) UpdateParentsIsPushed(db *gorm.DB, items []DBTable) error
- func (t Check) Value() any
- type CheckComponentRelationship
- func (t CheckComponentRelationship) GetUnpushed(db *gorm.DB) ([]DBTable, error)
- func (c CheckComponentRelationship) PK() string
- func (c *CheckComponentRelationship) Save(db *gorm.DB) error
- func (CheckComponentRelationship) TableName() string
- func (s CheckComponentRelationship) UpdateIsPushed(db *gorm.DB, items []DBTable) error
- type CheckConfigRelationship
- func (c CheckConfigRelationship) GetUnpushed(db *gorm.DB) ([]DBTable, error)
- func (c CheckConfigRelationship) PK() string
- func (c CheckConfigRelationship) PKCols() []clause.Column
- func (c *CheckConfigRelationship) Save(db *gorm.DB) error
- func (CheckConfigRelationship) TableName() string
- func (s CheckConfigRelationship) UpdateIsPushed(db *gorm.DB, items []DBTable) error
- func (c CheckConfigRelationship) Value() any
- type CheckHealthStatus
- type CheckStatus
- func (s CheckStatus) AsMap(removeFields ...string) map[string]any
- func (s CheckStatus) GetTime() (time.Time, error)
- func (s CheckStatus) GetUnpushed(db *gorm.DB) ([]DBTable, error)
- func (s CheckStatus) PK() string
- func (s CheckStatus) PKCols() []clause.Column
- func (c CheckStatus) Pretty() api.Text
- func (c CheckStatus) PrettyRow(opts interface{}) map[string]api.Text
- func (CheckStatus) TableName() string
- func (s CheckStatus) UpdateIsPushed(db *gorm.DB, items []DBTable) error
- func (t CheckStatus) UpdateParentsIsPushed(db *gorm.DB, items []DBTable) error
- func (t CheckStatus) Value() any
- type CheckStatusAggregate1d
- type CheckStatusAggregate1h
- type CheckSummary
- type Checks
- type ChecksUnlogged
- type ColumnType
- type Comment
- type Component
- func (c *Component) AsMap(removeFields ...string) map[string]any
- func (component Component) Clone() Component
- func (c Component) GetAgentID() string
- func (component Component) GetAsEnvironment() map[string]interface{}
- func (c Component) GetFieldsMatcher() fields.Fields
- func (c Component) GetHealth() (string, error)
- func (c Component) GetHealthDescription() string
- func (c Component) GetID() string
- func (t Component) GetLabels() map[string]string
- func (c Component) GetLabelsMatcher() labels.Labels
- func (c Component) GetName() string
- func (c Component) GetNamespace() string
- func (c Component) GetStatus() (string, error)
- func (t Component) GetTrimmedLabels() []Label
- func (c Component) GetType() string
- func (t Component) GetUnpushed(db *gorm.DB) ([]DBTable, error)
- func (component Component) IsHealthy() bool
- func (c *Component) ObjectMeta() metav1.ObjectMeta
- func (c Component) PK() string
- func (c Component) Pretty() api.Text
- func (c Component) PrettyRow(opts interface{}) map[string]api.Text
- func (c Component) QueryLogSummary() string
- func (component Component) String() string
- func (c *Component) Summarize(depth int) types.Summary
- func (c Component) TableName() string
- func (t Component) UpdateParentsIsPushed(db *gorm.DB, items []DBTable) error
- type ComponentRelationship
- func (cr ComponentRelationship) GetUnpushed(db *gorm.DB) ([]DBTable, error)
- func (cr ComponentRelationship) PK() string
- func (s ComponentRelationship) PKCols() []clause.Column
- func (ComponentRelationship) TableName() string
- func (s ComponentRelationship) UpdateIsPushed(db *gorm.DB, items []DBTable) error
- func (s ComponentRelationship) UpdateParentsIsPushed(db *gorm.DB, items []DBTable) error
- func (s ComponentRelationship) Value() any
- type Components
- type ConfigAccess
- type ConfigAccessLog
- type ConfigAccessSummary
- type ConfigAnalysis
- func (ConfigAnalysis) GetUnpushed(db *gorm.DB) ([]DBTable, error)
- func (a ConfigAnalysis) PK() string
- func (c ConfigAnalysis) PKCols() []clause.Column
- func (c ConfigAnalysis) Pretty() api.Text
- func (c ConfigAnalysis) PrettyRow(opts interface{}) map[string]api.Text
- func (a ConfigAnalysis) QueryLogSummary() string
- func (a ConfigAnalysis) String() string
- func (a ConfigAnalysis) TableName() string
- func (t ConfigAnalysis) UpdateParentsIsPushed(db *gorm.DB, items []DBTable) error
- func (c ConfigAnalysis) Value() any
- type ConfigChange
- func (c *ConfigChange) BeforeCreate(tx *gorm.DB) error
- func (c ConfigChange) Columns() []api.ColumnDef
- func (c ConfigChange) GetExternalID() ExternalID
- func (t ConfigChange) GetUnpushed(db *gorm.DB) ([]DBTable, error)
- func (c ConfigChange) PK() string
- func (c ConfigChange) PKCols() []clause.Column
- func (c ConfigChange) Pretty() api.Text
- func (c ConfigChange) PrettyRow(opts interface{}) map[string]api.Text
- func (c ConfigChange) Row() map[string]any
- func (c ConfigChange) RowDetail() api.Textable
- func (c ConfigChange) String() string
- func (c ConfigChange) TableName() string
- func (t ConfigChange) UpdateParentsIsPushed(db *gorm.DB, items []DBTable) error
- func (c ConfigChange) Value() any
- type ConfigChangeUpdate
- type ConfigComponentRelationship
- func (t ConfigComponentRelationship) GetUnpushed(db *gorm.DB) ([]DBTable, error)
- func (t ConfigComponentRelationship) PK() string
- func (s ConfigComponentRelationship) PKCols() []clause.Column
- func (ConfigComponentRelationship) TableName() string
- func (s ConfigComponentRelationship) UpdateIsPushed(db *gorm.DB, items []DBTable) error
- func (s ConfigComponentRelationship) UpdateParentsIsPushed(db *gorm.DB, items []DBTable) error
- func (s ConfigComponentRelationship) Value() any
- type ConfigCost
- type ConfigCostCompact
- type ConfigCostSummary
- type ConfigItem
- func (ci ConfigItem) AsMap(removeFields ...string) map[string]any
- func (config ConfigItem) Clone() ConfigItem
- func (ci *ConfigItem) ConfigJSONStringMap() (map[string]any, error)
- func (ci *ConfigItem) FromMap(data map[string]any) error
- func (c ConfigItem) GetAgentID() string
- func (c ConfigItem) GetFieldsMatcher() fields.Fields
- func (c ConfigItem) GetHealth() (string, error)
- func (c ConfigItem) GetHealthDescription() string
- func (c ConfigItem) GetID() string
- func (t ConfigItem) GetLabels() map[string]string
- func (c ConfigItem) GetLabelsMatcher() labels.Labels
- func (c ConfigItem) GetName() string
- func (c ConfigItem) GetNamespace() string
- func (c ConfigItem) GetSelectorID() string
- func (c ConfigItem) GetStatus() (string, error)
- func (t ConfigItem) GetTags() map[string]string
- func (c ConfigItem) GetTagsMatcher() labels.Labels
- func (t ConfigItem) GetTrimmedLabels() []Label
- func (c ConfigItem) GetType() string
- func (t ConfigItem) GetUnpushed(db *gorm.DB) ([]DBTable, error)
- func (ci *ConfigItem) NestedString(paths ...string) string
- func (t ConfigItem) PK() string
- func (t ConfigItem) PKCols() []clause.Column
- func (c ConfigItem) Pretty() api.Text
- func (c ConfigItem) PrettyRow(opts interface{}) map[string]api.Text
- func (c ConfigItem) QueryLogSummary() string
- func (ci *ConfigItem) SetParent(parent *ConfigItem)
- func (ci ConfigItem) String() string
- func (ConfigItem) TableName() string
- func (t ConfigItem) UpdateParentsIsPushed(db *gorm.DB, items []DBTable) error
- func (c ConfigItem) Value() any
- type ConfigItemLastScrapedTime
- func (ConfigItemLastScrapedTime) GetUnpushed(db *gorm.DB) ([]DBTable, error)
- func (c ConfigItemLastScrapedTime) PK() string
- func (ConfigItemLastScrapedTime) PKCols() []clause.Column
- func (ConfigItemLastScrapedTime) TableName() string
- func (ConfigItemLastScrapedTime) UpdateIsPushed(db *gorm.DB, items []DBTable) error
- func (ConfigItemLastScrapedTime) UpdateParentsIsPushed(db *gorm.DB, items []DBTable) error
- func (c ConfigItemLastScrapedTime) Value() any
- type ConfigItemSummary
- type ConfigLocation
- type ConfigRelationship
- func (t ConfigRelationship) GetUnpushed(db *gorm.DB) ([]DBTable, error)
- func (cr ConfigRelationship) PK() string
- func (c ConfigRelationship) PKCols() []clause.Column
- func (cr ConfigRelationship) TableName() string
- func (s ConfigRelationship) UpdateIsPushed(db *gorm.DB, items []DBTable) error
- func (t ConfigRelationship) UpdateParentsIsPushed(db *gorm.DB, items []DBTable) error
- func (c ConfigRelationship) Value() any
- type ConfigScraper
- func (c ConfigScraper) AsMap(removeFields ...string) map[string]any
- func (cs *ConfigScraper) BeforeCreate(tx *gorm.DB) error
- func (c ConfigScraper) GetAgentID() string
- func (c ConfigScraper) GetNamespace() string
- func (c ConfigScraper) GetUnpushed(db *gorm.DB) ([]DBTable, error)
- func (c ConfigScraper) PK() string
- func (c ConfigScraper) TableName() string
- type Connection
- func (c Connection) AsEnv(ctx context.Context) EnvPrep
- func (c Connection) AsGoGetterURL() (string, error)
- func (c Connection) AsMap(removeFields ...string) map[string]any
- func (c *Connection) GetFieldsMatcher() fields.Fields
- func (c *Connection) GetHealth() (string, error)
- func (c *Connection) GetID() string
- func (c *Connection) GetLabelsMatcher() labels.Labels
- func (c *Connection) GetName() string
- func (c *Connection) GetNamespace() string
- func (c *Connection) GetStatus() (string, error)
- func (c *Connection) GetType() string
- func (c Connection) Merge(ctx types.GetEnvVarFromCache, from any) (*Connection, error)
- func (c Connection) PK() string
- func (c *Connection) SetProperty(key, value string)
- func (c Connection) String() string
- func (c Connection) TableName() string
- type Contextable
- type DBTable
- type Deleteable
- type EnvPrep
- type Event
- type EventQueueSummary
- type Events
- type Evidence
- type EvidenceCanaryCheck
- type EvidenceComponent
- type EvidenceConfig
- type EvidenceConfigAnalysis
- type EvidenceConfigChange
- type EvidenceLogs
- type ExtendedDBTable
- type ExternalGroup
- func (e ExternalGroup) GetAliases() []string
- func (e ExternalGroup) GetFieldsMatcher() fields.Fields
- func (e ExternalGroup) GetID() string
- func (e ExternalGroup) GetName() string
- func (e ExternalGroup) GetType() string
- func (e ExternalGroup) PK() string
- func (e *ExternalGroup) SetAliases(aliases []string)
- func (e ExternalGroup) TableName() string
- type ExternalID
- type ExternalRole
- type ExternalUser
- func (e ExternalUser) GetAliases() []string
- func (e ExternalUser) GetFieldsMatcher() fields.Fields
- func (e ExternalUser) GetID() string
- func (e ExternalUser) GetName() string
- func (e ExternalUser) GetType() string
- func (e ExternalUser) PK() string
- func (e *ExternalUser) SetAliases(aliases []string)
- func (e ExternalUser) TableName() string
- type ExternalUserAlias
- type ExternalUserGroup
- type GeneratedViewTable
- func (v GeneratedViewTable) AsMap(removeFields ...string) map[string]any
- func (t GeneratedViewTable) GetUnpushed(db *gorm.DB) ([]DBTable, error)
- func (v GeneratedViewTable) PK() string
- func (v GeneratedViewTable) TableName() string
- func (t GeneratedViewTable) UpdateIsPushed(db *gorm.DB, items []DBTable) error
- type Health
- type Hypothesis
- type Incident
- type IncidentStatus
- type IncidentType
- type Integration
- type IntegrationType
- type Invite
- type JobHistory
- func (h *JobHistory) AddDetails(key string, val any)
- func (h *JobHistory) AddError(err any) *JobHistory
- func (h *JobHistory) AddErrorWithSkipReportLevel(err string, level int) *JobHistory
- func (h *JobHistory) AddErrorf(msg string, args ...interface{}) *JobHistory
- func (j JobHistory) AsError() error
- func (h *JobHistory) End() *JobHistory
- func (j JobHistory) GetAgentID() string
- func (j JobHistory) GetUnpushed(db *gorm.DB) ([]DBTable, error)
- func (h *JobHistory) IncrSuccess() *JobHistory
- func (j JobHistory) PK() string
- func (h *JobHistory) Persist(db *gorm.DB) error
- func (h *JobHistory) Start() *JobHistory
- func (h *JobHistory) String() string
- func (j JobHistory) TableName() string
- type JobStatus
- type Label
- type LabelableModel
- type Link
- type LocalTime
- type LogLine
- type LogNameAccessor
- type LoggingBackend
- type NamespaceScopeAccessor
- type Notification
- type NotificationGroup
- type NotificationGroupResource
- type NotificationSendHistory
- func (n NotificationSendHistory) AsMap(removeFields ...string) map[string]any
- func (t *NotificationSendHistory) End() *NotificationSendHistory
- func (t *NotificationSendHistory) PendingPlaybookRun() *NotificationSendHistory
- func (t *NotificationSendHistory) Sent() *NotificationSendHistory
- func (t *NotificationSendHistory) TableName() string
- func (t *NotificationSendHistory) WithStartTime(s time.Time) *NotificationSendHistory
- type NotificationSilence
- type NotificationSilenceResource
- type NotificationSummary
- type Permission
- type PermissionGroup
- type PermissionSubjectType
- type Person
- type PersonProperties
- type Playbook
- func (p Playbook) AsMap(removeFields ...string) map[string]any
- func (p Playbook) Context() map[string]any
- func (p *Playbook) GetFieldsMatcher() fields.Fields
- func (p *Playbook) GetHealth() (string, error)
- func (p *Playbook) GetID() string
- func (p *Playbook) GetLabelsMatcher() labels.Labels
- func (p *Playbook) GetName() string
- func (p *Playbook) GetNamespace() string
- func (p *Playbook) GetStatus() (string, error)
- func (p *Playbook) GetTagsMatcher() labels.Labels
- func (p *Playbook) GetType() string
- func (p Playbook) Load(db *gorm.DB) (*Playbook, error)
- func (p *Playbook) LoggerName() string
- func (p *Playbook) NamespacedName() string
- func (p Playbook) PK() string
- func (p Playbook) Pretty() api.Text
- func (p Playbook) PrettyRow(opts interface{}) map[string]api.Text
- func (p *Playbook) Save(db *gorm.DB) error
- func (p Playbook) SelectableFields() map[string]any
- func (p Playbook) TableName() string
- type PlaybookActionAgentData
- type PlaybookActionStatus
- type PlaybookApproval
- type PlaybookRun
- func (p PlaybookRun) AsMap(removeFields ...string) map[string]any
- func (p PlaybookRun) Assign(db *gorm.DB, agent *Agent, action string) error
- func (p PlaybookRun) Cancel(db *gorm.DB) error
- func (p PlaybookRun) Context() map[string]any
- func (p PlaybookRun) Delay(db *gorm.DB, delay time.Duration) error
- func (p PlaybookRun) End(db *gorm.DB) error
- func (p PlaybookRun) EndAsTimedOut(db *gorm.DB) error
- func (p PlaybookRun) Fail(db *gorm.DB, err error) error
- func (run *PlaybookRun) GetABACAttributes(db *gorm.DB) (*ABACAttribute, error)
- func (p PlaybookRun) GetAction(db *gorm.DB, name string) (action *PlaybookRunAction, err error)
- func (p PlaybookRun) GetActions(db *gorm.DB) (actions []PlaybookRunAction, err error)
- func (p PlaybookRun) GetAgentAction(db *gorm.DB, name string) (*PlaybookRunAction, error)
- func (p PlaybookRun) GetAgentActions(db *gorm.DB) (actions []PlaybookRunAction, err error)
- func (p PlaybookRun) GetPlaybook(db *gorm.DB) (*Playbook, error)
- func (p PlaybookRun) Load(db *gorm.DB) (*PlaybookRun, error)
- func (p PlaybookRun) PK() string
- func (p PlaybookRun) Pretty() api.Text
- func (p PlaybookRun) PrettyRow(opts interface{}) map[string]api.Text
- func (p PlaybookRun) ResumeChildrenWaitingAction(db *gorm.DB) error
- func (p PlaybookRun) Retry(db *gorm.DB, delay time.Duration) error
- func (p PlaybookRun) RetryAction(db *gorm.DB, action string, retryCount int) (*PlaybookRunAction, error)
- func (p PlaybookRun) Running(db *gorm.DB) error
- func (p PlaybookRun) Schedule(db *gorm.DB) error
- func (p PlaybookRun) StartAction(db *gorm.DB, action string) (*PlaybookRunAction, error)
- func (p *PlaybookRun) String(db *gorm.DB) string
- func (p PlaybookRun) TableName() string
- func (p PlaybookRun) Update(db *gorm.DB, columns map[string]any) error
- func (p PlaybookRun) Waiting(db *gorm.DB) error
- type PlaybookRunAction
- func (p PlaybookRunAction) AsMap(removeFields ...string) map[string]any
- func (p PlaybookRunAction) Complete(db *gorm.DB, result any) error
- func (p PlaybookRunAction) Context() map[string]any
- func (p PlaybookRunAction) Fail(db *gorm.DB, result any, err error) error
- func (p PlaybookRunAction) GetPlaybook(db *gorm.DB) (*Playbook, error)
- func (p PlaybookRunAction) GetRun(db *gorm.DB) (*PlaybookRun, error)
- func (p PlaybookRunAction) JSON() (out map[string]any)
- func (p PlaybookRunAction) Load(db *gorm.DB) (*PlaybookRunAction, error)
- func (p PlaybookRunAction) PK() string
- func (p PlaybookRunAction) ScheduleRun(db *gorm.DB) error
- func (p PlaybookRunAction) Skip(db *gorm.DB) error
- func (p PlaybookRunAction) Start(db *gorm.DB) error
- func (p PlaybookRunAction) String() string
- func (p PlaybookRunAction) TableName() string
- func (p PlaybookRunAction) Update(db *gorm.DB, columns map[string]any) error
- func (p PlaybookRunAction) UpdateRun(db *gorm.DB, columns map[string]any) error
- func (p PlaybookRunAction) WaitForChildren(db *gorm.DB) error
- type PlaybookRunStatus
- type Plugin
- type Properties
- func (p Properties) AsJSON() []byte
- func (p Properties) AsMap() map[string]any
- func (p Properties) Find(name string) *Property
- func (Properties) GormDBDataType(db *gorm.DB, field *schema.Field) string
- func (Properties) GormDataType() string
- func (p Properties) GormValue(ctx context.Context, db *gorm.DB) clause.Expr
- func (p *Properties) Scan(val any) error
- func (p Properties) Value() (driver.Value, error)
- type Property
- type RelatedConfigDirection
- type Responder
- type Scope
- type ScrapePlugin
- type Severity
- type ShortURL
- type TaggableModel
- type Team
- type Text
- type Topology
- func (t *Topology) AsMap(removeFields ...string) map[string]any
- func (t Topology) GetAgentID() string
- func (t Topology) GetNamespace() string
- func (t Topology) GetUnpushed(db *gorm.DB) ([]DBTable, error)
- func (t Topology) OnConflictClause() clause.OnConflict
- func (t Topology) PK() string
- func (t *Topology) Save(db *gorm.DB) error
- func (Topology) TableName() string
- type View
- func (v View) AsMap(removeFields ...string) map[string]any
- func (v View) GeneratedTableName() string
- func (v View) GetFieldsMatcher() fields.Fields
- func (v View) GetHealth() (string, error)
- func (v View) GetID() string
- func (v View) GetLabelsMatcher() labels.Labels
- func (v View) GetName() string
- func (v View) GetNamespace() string
- func (v View) GetStatus() (string, error)
- func (v View) GetType() string
- func (v View) PK() string
- func (View) TableName() string
- type ViewPanel
Constants ¶
const ( CheckStatusHealthy = "healthy" CheckStatusUnhealthy = "unhealthy" )
const ( SQLiteTypeINTEGER = "INTEGER" SQLiteTypeREAL = "REAL" SQLiteTypeTEXT = "TEXT" SQLiteTypeBLOB = "BLOB" )
SQLite fundamental data types
const ( ConfigClassCluster = "Cluster" ConfigClassDatabase = "Database" ConfigClassDeployment = "Deployment" ConfigClassNamespace = "Namespace" ConfigClassNode = "Node" ConfigClassPod = "Pod" ConfigClassVirtualMachine = "VirtualMachine" )
Config classes
const ( ConfigStatusCordoned = "Cordoned" ConfigStatusCordoning = "Cordoning" ConfigStatusDeleted = "Deleted" ConfigStatusDeleting = "Deleting" ConfigStatusFailed = "Failed" ConfigStatusPending = "Pending" ConfigStatusRunning = "Running" ConfigStatusStarting = "Starting" ConfigStatusStopped = "Stopped" ConfigStatusStopping = "Stopping" ConfigStatusSucceeded = "Succeeded" ConfigStatusUncordoned = "Uncordoned" ConfigStatusUnknown = "Unknown" )
Config Statuses
const ( AnalysisStatusOpen = "open" AnalysisStatusResolved = "resolved" AnalysisStatusSilenced = "silenced" )
Config Analysis statuses
const ( ConfigCostLevel1 = "level1" ConfigCostLevel2 = "level2" ConfigCostLevel3 = "level3" )
Compaction levels. Charge periods are snapped to one of these, never split.
The stored value names the level rather than its width, so the width is an operator setting rather than a schema decision — config.costs.level1/2/3, defaulting to 1h, 1d and 30d. Changing a width is a property change; it does not rename a column or need a migration.
Each level's width must divide the next exactly, so compaction from one to the next is pure summation and never splits a row across a boundary. The job validates that before it compacts anything.
const ( ConnectionTypeAnthropic = "anthropic" ConnectionTypeAWS = "aws" ConnectionTypeAWSKMS = "aws_kms" ConnectionTypeAzure = "azure" ConnectionTypeAzureDevops = "azure_devops" ConnectionTypeAzureKeyVault = "azure_key_vault" ConnectionTypeDiscord = "discord" ConnectionTypeDynatrace = "dynatrace" ConnectionTypeElasticSearch = "elasticsearch" ConnectionTypeEmail = "email" ConnectionTypeFacet = "facet" ConnectionTypeFolder = "folder" ConnectionTypeGCP = "google_cloud" ConnectionTypeGCPKMS = "gcp_kms" ConnectionTypeGCS = "gcs" ConnectionTypeGemini = "gemini" ConnectionTypeGenericWebhook = "generic_webhook" ConnectionTypeGit = "git" ConnectionTypeGithub = "github" ConnectionTypeGitlab = "gitlab" ConnectionTypeGoogleChat = "google_chat" ConnectionTypeHTTP = "http" ConnectionTypeIFTTT = "ifttt" ConnectionTypeJMeter = "jmeter" ConnectionTypeKubernetes = "kubernetes" ConnectionTypeLDAP = "ldap" ConnectionTypeLoki = "loki" ConnectionTypeMatrix = "matrix" ConnectionTypeMattermost = "mattermost" ConnectionTypeMongo = "mongo" ConnectionTypeMySQL = "mysql" ConnectionTypeNtfy = "ntfy" ConnectionTypeOllama = "ollama" ConnectionTypeOpenAI = "openai" ConnectionTypeOpenSearch = "opensearch" ConnectionTypeOpsGenie = "opsgenie" ConnectionTypePostgres = "postgres" ConnectionTypePrometheus = "prometheus" ConnectionTypePushbullet = "pushbullet" ConnectionTypePushover = "pushover" ConnectionTypeRedis = "redis" ConnectionTypeRestic = "restic" ConnectionTypeRocketchat = "rocketchat" ConnectionTypeS3 = "s3" ConnectionTypeSFTP = "sftp" ConnectionTypeSlack = "slack" ConnectionTypeSlackWebhook = "slackwebhook" ConnectionTypeSMB = "smb" ConnectionTypeSQLServer = "sql_server" ConnectionTypeTeams = "teams" ConnectionTypeTelegram = "telegram" ConnectionTypeWebhook = "webhook" ConnectionTypeWindows = "windows" ConnectionTypeZulipChat = "zulip_chat" )
List of all connection types
const ( StatusRunning = "RUNNING" StatusSuccess = "SUCCESS" StatusWarning = "WARNING" StatusFailed = "FAILED" StatusStale = "STALE" StatusSkipped = "SKIPPED" )
const ( NotificationStatusError = "error" NotificationStatusSent = "sent" NotificationStatusPending = "pending" // delayed due to waitFor evaluation NotificationStatusSkipped = "skipped" // due to waitFor evaluation NotificationStatusSilenced = "silenced" NotificationStatusRepeatInterval = "repeat-interval" // notification is inhibited by another notification NotificationStatusInhibited = "inhibited" // an event was triggered and the notification is waiting for the playbook run to be triggered. NotificationStatusPendingPlaybookRun = "pending_playbook_run" // A playbook is currently in progress NotificationStatusPendingPlaybookCompletion = "pending_playbook_completion" // health related notifications of kubernetes config items get into this state // to wait for the incremental scraper to re-evaluate the health. NotificationStatusEvaluatingWaitFor = "evaluating-waitfor" // Attempting delivery through a fallback channel NotificationStatusAttemptingFallback = "attempting_fallback" )
const ( SourceCRD = "KubernetesCRD" SourceConfigFile = "ConfigFile" SourceUI = "UI" SourceTopology = "Topology" SourcePush = "Push" SourceCRDSync = "CRDSync" SourceApplicationCRD = "ApplicationCRD" )
const TimeFormat = "2006-01-02T15:04:05"
Variables ¶
var AllowedColumnFieldsInPlaybooks = []string{"category"}
var CheckHealthStatuses = []CheckHealthStatus{ CheckStatusHealthy, CheckStatusUnhealthy, }
var CheckID = func(c Check) string {
return c.ID.String()
}
var ComponentID = func(c Component) string {
return c.ID.String()
}
var ConfigCostLevels = []string{ConfigCostLevel1, ConfigCostLevel2, ConfigCostLevel3}
ConfigCostLevels lists the levels from finest to coarsest.
var ConfigID = func(c ConfigComponentRelationship, i int) string {
return c.ConfigID.String()
}
var ConfigSelectorID = func(c ConfigComponentRelationship, i int) string {
return c.SelectorID
}
var LocalAgentConfigID = uuid.Max
var PlaybookActionFinalStates = []PlaybookActionStatus{ PlaybookActionStatusFailed, PlaybookActionStatusCompleted, PlaybookActionStatusSkipped, }
var PlaybookRunStatusExecutingGroup = []PlaybookRunStatus{ PlaybookRunStatusRunning, PlaybookRunStatusScheduled, PlaybookRunStatusSleeping, PlaybookRunStatusRetrying, PlaybookRunStatusWaiting, PlaybookRunStatusPendingApproval, }
var PlaybookRunStatusFinalStates = []PlaybookRunStatus{ PlaybookRunStatusCancelled, PlaybookRunStatusCompleted, PlaybookRunStatusFailed, PlaybookRunStatusTimedOut, }
var UnsuccessfulPlaybookRunFinalStates = []PlaybookRunStatus{ PlaybookRunStatusCancelled, PlaybookRunStatusFailed, PlaybookRunStatusTimedOut, }
Functions ¶
func ChangeFingerprintCacheKey ¶ added in v1.0.1308
func ConvertRowToNativeTypes ¶ added in v1.0.983
func ConvertRowToNativeTypes(row map[string]any, columnDef map[string]ColumnType) (map[string]any, map[string]string)
ConvertRowToNativeTypes converts a database row to native go types
func DedupConfigChanges ¶ added in v1.0.1308
func DedupConfigChanges(window time.Duration, changes []*ConfigChange) ([]*ConfigChange, []ConfigChangeUpdate)
DedupConfigChanges deduplicates config changes by (config_id, fingerprint). New fingerprints are returned in nonDuped for insertion; fingerprints already present in the cache are returned as updates with CountIncrement.
func DeleteAllCanaries ¶ added in v1.0.561
func DeleteAllComponents ¶ added in v1.0.561
func DeleteAllConfigs ¶ added in v1.0.561
func DeleteAllConfigs(db *gorm.DB, configs ...ConfigItem) error
func DeleteAllIncidents ¶ added in v1.0.561
func DeleteCheckComponentRelationshipsForCanary ¶ added in v1.0.510
func DeleteChecksForCanary ¶ added in v1.0.510
func DeleteComponentChildren ¶ added in v1.0.510
func DeleteComponentsWithIDs ¶ added in v1.0.510
DeleteComponentsWithID deletes all components with specified ids.
func DeleteInlineCanariesForComponent ¶ added in v1.0.510
func ErrorContext ¶ added in v1.0.564
func ErrorContext(items ...Contextable) []any
func EventQueueUniqueConstraint ¶ added in v1.0.1213
func GenerateFallbackAttempt ¶ added in v1.0.867
func GenerateFallbackAttempt(db *gorm.DB, notification Notification, history NotificationSendHistory) error
GenerateFallbackAttempt creates a new notification history record based on the provided history for retrying with fallback recipients.
func InitChangeFingerprintCache ¶ added in v1.0.1308
func SetProperties ¶ added in v1.0.145
func SetProperties(db *gorm.DB, props []AppProperty) error
func SetPropertiesInDBFromFile ¶ added in v1.0.145
Types ¶
type ABACAttribute ¶ added in v1.0.816
type ABACAttribute struct {
Playbook Playbook
Connection Connection
Component Component
Config ConfigItem
Check Check
Canary Canary
View View
}
ABACAttribute is the object passed to casbin for authorization checks.
NOTE: the fields are not a pointer to avoid nil pointer checks in the casbin policy.
type AccessReview ¶ added in v1.0.937
type AccessReview struct {
ID uuid.UUID `json:"id"`
ScraperID uuid.UUID `json:"scraper_id" gorm:"not null"`
Aliases pq.StringArray `json:"aliases" gorm:"type:[]text"`
ConfigID uuid.UUID `json:"config_id"`
ExternalGroupID *uuid.UUID `json:"external_group_id"`
ExternalUserID *uuid.UUID `json:"external_user_id"`
ExternalRoleID uuid.UUID `json:"external_role_id"`
CreatedAt time.Time `json:"created_at" gorm:"<-:create"`
CreatedBy *uuid.UUID `json:"created_by"`
Source string `json:"source"`
}
func (AccessReview) PK ¶ added in v1.0.937
func (e AccessReview) PK() string
func (AccessReview) TableName ¶ added in v1.0.937
func (e AccessReview) TableName() string
type AccessToken ¶ added in v1.0.143
type AccessToken struct {
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
Name string `json:"name" gorm:"not null"`
Value string `json:"-" gorm:"not null"`
AutoRenew bool `json:"auto_renew"`
PersonID uuid.UUID `json:"person_id" gorm:"not null"`
CreatedAt time.Time `json:"created_at" gorm:"<-:create"`
CreatedBy *uuid.UUID `json:"created_by,omitempty"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
}
func (AccessToken) PK ¶ added in v1.0.561
func (a AccessToken) PK() string
func (AccessToken) TableName ¶ added in v1.0.143
func (AccessToken) TableName() string
type Agent ¶ added in v1.0.91
type Agent struct {
ID uuid.UUID `json:"id,omitempty" gorm:"default:generate_ulid()"`
Name string `json:"name"`
Hostname string `json:"hostname,omitempty"`
Description string `json:"description,omitempty"`
IP string `json:"ip,omitempty"`
Version string `json:"version,omitempty"`
Username string `json:"username,omitempty"`
PersonID *uuid.UUID `json:"person_id,omitempty"`
Properties types.JSONStringMap `json:"properties,omitempty"`
TLS string `json:"tls,omitempty"`
CreatedBy *uuid.UUID `json:"created_by,omitempty"`
CreatedAt time.Time `json:"created_at" time_format:"postgres_timestamp"`
DeletedAt *time.Time `json:"deleted_at" time_format:"postgres_timestamp"`
UpdatedAt time.Time `json:"updated_at" time_format:"postgres_timestamp"`
// Cleanup when set to true will delete all the agent resources when the agent is deleted
Cleanup bool `json:"cleanup"`
// LastSeen is the timestamp the agent last sent a heartbeat
LastSeen *time.Time `json:"last_seen,omitempty" time_format:"postgres_timestamp"`
// LastReceived is the timestamp the agent last sent a push data
LastReceived *time.Time `json:"last_received,omitempty" time_format:"postgres_timestamp"`
}
type AnalysisType ¶ added in v1.0.117
type AnalysisType string
const ( AnalysisTypeAvailability AnalysisType = "availability" AnalysisTypeCompliance AnalysisType = "compliance" AnalysisTypeCost AnalysisType = "cost" AnalysisTypeIntegration AnalysisType = "integration" AnalysisTypeOther AnalysisType = "other" AnalysisTypePerformance AnalysisType = "performance" AnalysisTypeRecommendation AnalysisType = "recommendation" AnalysisTypeReliability AnalysisType = "reliability" AnalysisTypeSecurity AnalysisType = "security" AnalysisTypeTechDebt AnalysisType = "technical_debt" )
func (AnalysisType) Pretty ¶ added in v1.0.1168
func (a AnalysisType) Pretty() api.Text
type AppProperty ¶ added in v1.0.144
type AppProperty struct {
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
CreatedBy *uuid.UUID `json:"created_by,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty" time_format:"postgres_timestamp" gorm:"default:CURRENT_TIMESTAMP()"`
UpdatedAt time.Time `json:"updated_at,omitempty" time_format:"postgres_timestamp" gorm:"default:CURRENT_TIMESTAMP()"`
DeletedAt *time.Time `json:"deleted_at,omitempty" time_format:"postgres_timestamp" gorm:"default:CURRENT_TIMESTAMP()"`
}
func (AppProperty) PK ¶ added in v1.0.561
func (p AppProperty) PK() string
func (AppProperty) TableName ¶ added in v1.0.234
func (p AppProperty) TableName() string
type Application ¶ added in v1.0.941
type Application struct {
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
Name string `json:"name"`
Namespace string `json:"namespace,omitempty" gorm:"default:NULL"`
Description string `json:"description,omitempty" gorm:"default:NULL"`
Spec string `json:"spec"`
Source string `json:"source,omitempty"`
Labels types.JSONStringMap `json:"labels,omitempty" gorm:"default:NULL"`
CreatedBy *uuid.UUID `json:"created_by,omitempty" gorm:"default:NULL"`
CreatedAt time.Time `json:"created_at" gorm:"<-:create"`
UpdatedAt *time.Time `json:"updated_at,omitempty" gorm:"autoUpdateTime:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
func (Application) PK ¶ added in v1.0.941
func (a Application) PK() string
func (Application) TableName ¶ added in v1.0.941
func (a Application) TableName() string
type Artifact ¶ added in v1.0.225
type Artifact struct {
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
CheckID *uuid.UUID `json:"check_id,omitempty"`
CheckTime *time.Time `json:"check_time,omitempty" time_format:"postgres_timestamp"`
ConfigChangeID *uuid.UUID `json:"config_change_id,omitempty"`
// Playbook action that created this artifact
PlaybookRunActionID *uuid.UUID `json:"playbook_run_action_id,omitempty"`
// ScraperID is the durable owner for scraper-generated artifacts.
ScraperID *uuid.UUID `json:"scraper_id,omitempty"`
// JobHistoryID records the creating job run provenance for scraper-generated artifacts.
// It may become nil when job_history retention prunes old rows.
JobHistoryID *uuid.UUID `json:"job_history_id,omitempty"`
ConnectionID uuid.UUID `json:"connection_id,omitempty"`
Path string `json:"path"`
IsPushed bool `json:"is_pushed"`
IsDataPushed bool `json:"is_data_pushed"`
Filename string `json:"filename"`
Size int64 `json:"size"` // Size in bytes
ContentType string `json:"content_type,omitempty"`
Checksum string `json:"checksum"`
Content []byte `json:"-" gorm:"type:bytea"`
CompressionType string `json:"compression_type,omitempty"`
CreatedAt time.Time `json:"created_at" yaml:"created_at" time_format:"postgres_timestamp"`
UpdatedAt time.Time `json:"updated_at" yaml:"updated_at" time_format:"postgres_timestamp"`
DeletedAt *time.Time `json:"deleted_at,omitempty" yaml:"deleted_at,omitempty" time_format:"postgres_timestamp"`
ExpiresAt *time.Time `json:"expires_at,omitempty" yaml:"expires_at,omitempty" time_format:"postgres_timestamp"`
}
Artifact represents the artifacts table
func (Artifact) GetContent ¶ added in v1.0.1244
GetContent decompresses and returns the inline content.
func (Artifact) GetUnpushed ¶ added in v1.0.362
func (*Artifact) SetContent ¶ added in v1.0.1244
SetContent compresses data using the given compression type and sets the Content and CompressionType fields. maxSize is checked against the post-compression size; returns an error if exceeded.
type Canary ¶ added in v1.0.15
type Canary struct {
ID uuid.UUID `json:"id" yaml:"id" gorm:"default:generate_ulid()"`
Name string `json:"name" yaml:"name"`
Namespace string `json:"namespace" yaml:"namespace"`
AgentID uuid.UUID `json:"agent_id" yaml:"agent_id"`
Spec types.JSON `json:"spec" yaml:"spec"`
Labels types.JSONStringMap `json:"labels,omitempty" yaml:"labels,omitempty"`
Annotations types.JSONStringMap `json:"annotations,omitempty" yaml:"annotations,omitempty"`
Source string `json:"source,omitempty" yaml:"source,omitempty"`
Checks types.JSONStringMap `gorm:"-" json:"checks,omitempty" yaml:"checks,omitempty"`
CreatedAt time.Time `json:"created_at" yaml:"created_at" time_format:"postgres_timestamp" gorm:"<-:create"`
UpdatedAt *time.Time `json:"updated_at" yaml:"updated_at" time_format:"postgres_timestamp" gorm:"autoUpdateTime:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty" yaml:"deleted_at,omitempty" time_format:"postgres_timestamp"`
}
func (Canary) ConflictClause ¶ added in v1.0.438
func (t Canary) ConflictClause() clause.OnConflict
func (Canary) GetAgentID ¶ added in v1.0.1064
func (Canary) GetCheckID ¶ added in v1.0.15
func (Canary) GetFieldsMatcher ¶ added in v1.0.777
func (Canary) GetLabelsMatcher ¶ added in v1.0.777
func (Canary) GetNamespace ¶ added in v1.0.777
func (Canary) GetUnpushed ¶ added in v1.0.362
func (Canary) QueryLogSummary ¶ added in v1.0.1230
type CatalogChange ¶ added in v1.0.963
type CatalogChange struct {
ID uuid.UUID `gorm:"primaryKey;column:id" json:"id"`
ConfigID uuid.UUID `gorm:"column:config_id" json:"config_id"`
Config types.JSON `gorm:"column:config" json:"config"`
Name *string `gorm:"column:name" json:"name"`
DeletedAt *time.Time `gorm:"column:deleted_at" json:"deleted_at"`
Type *string `gorm:"column:type" json:"type"`
Tags types.JSONStringMap `gorm:"column:tags" json:"tags"`
ExternalCreatedBy *string `gorm:"column:external_created_by" json:"external_created_by"`
CreatedAt *time.Time `gorm:"column:created_at" json:"created_at"`
Severity *string `gorm:"column:severity" json:"severity"`
ChangeType string `gorm:"column:change_type" json:"change_type"`
Source *string `gorm:"column:source" json:"source"`
Details types.JSON `json:"details,omitempty"`
Summary *string `gorm:"column:summary" json:"summary"`
CreatedBy *uuid.UUID `gorm:"column:created_by" json:"created_by"`
Count int `gorm:"column:count" json:"count"`
FirstObserved *time.Time `gorm:"column:first_observed" json:"first_observed"`
AgentID *uuid.UUID `gorm:"column:agent_id" json:"agent_id"`
Path string `gorm:"column:path" json:"path"`
InsertedAt *time.Time `gorm:"column:inserted_at" json:"inserted_at,omitempty"`
}
CatalogChange represents the catalog_changes view
func (CatalogChange) AsMap ¶ added in v1.0.963
func (c CatalogChange) AsMap(removeFields ...string) map[string]any
func (CatalogChange) GetID ¶ added in v1.0.963
func (c CatalogChange) GetID() string
func (CatalogChange) GetName ¶ added in v1.0.963
func (c CatalogChange) GetName() string
func (CatalogChange) GetNamespace ¶ added in v1.0.963
func (c CatalogChange) GetNamespace() string
func (CatalogChange) GetType ¶ added in v1.0.963
func (c CatalogChange) GetType() string
func (CatalogChange) PK ¶ added in v1.0.963
func (c CatalogChange) PK() string
func (CatalogChange) TableName ¶ added in v1.0.963
func (c CatalogChange) TableName() string
type Check ¶ added in v1.0.15
type Check struct {
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
CanaryID uuid.UUID `json:"canary_id"`
AgentID uuid.UUID `json:"agent_id,omitempty"`
Spec types.JSON `json:"-"`
Type string `json:"type"`
Name string `json:"name"`
Namespace string `json:"namespace"`
Labels types.JSONStringMap `json:"labels" gorm:"type:jsonstringmap"`
Description string `json:"description,omitempty"`
Status CheckHealthStatus `json:"status,omitempty"`
Owner string `json:"owner,omitempty"`
Severity Severity `json:"severity,omitempty"`
Icon string `json:"icon,omitempty"`
Transformed bool `json:"transformed,omitempty"`
LastTransitionTime *time.Time `json:"last_transition_time,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty" gorm:"<-:create"`
UpdatedAt *time.Time `json:"updated_at,omitempty" gorm:"autoUpdateTime:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
SilencedAt *time.Time `json:"silenced_at,omitempty"`
// Auxiliary fields
CanaryName string `json:"canary_name,omitempty" gorm:"-"`
ComponentIDs []string `json:"components,omitempty" gorm:"-"` // Linked component ids
Uptime types.Uptime `json:"uptime,omitempty" gorm:"-"`
Latency types.Latency `json:"latency,omitempty" gorm:"-"`
Statuses []CheckStatus `json:"checkStatuses,omitempty" gorm:"-"`
DisplayType string `json:"display_type,omitempty" gorm:"-"`
// These are calculated for the selected date range
EarliestRuntime *time.Time `json:"earliestRuntime,omitempty" gorm:"-"`
LatestRuntime *time.Time `json:"latestRuntime,omitempty" gorm:"-"`
TotalRuns int `json:"totalRuns,omitempty" gorm:"-"`
}
func (Check) GetAgentID ¶ added in v1.0.1064
func (Check) GetDescription ¶ added in v1.0.15
func (Check) GetFieldsMatcher ¶ added in v1.0.401
func (Check) GetHealthDescription ¶ added in v1.0.930
func (Check) GetLabelsMatcher ¶ added in v1.0.401
func (Check) GetNamespace ¶ added in v1.0.397
func (Check) GetTrimmedLabels ¶ added in v1.0.981
func (Check) GetUnpushed ¶ added in v1.0.362
func (Check) QueryLogSummary ¶ added in v1.0.1230
func (Check) UpdateParentsIsPushed ¶ added in v1.0.428
type CheckComponentRelationship ¶ added in v1.0.77
type CheckComponentRelationship struct {
ComponentID uuid.UUID `json:"component_id,omitempty"`
CheckID uuid.UUID `json:"check_id,omitempty"`
CanaryID uuid.UUID `json:"canary_id,omitempty"`
SelectorID string `json:"selector_id,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty" gorm:"autoUpdateTime:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
func (CheckComponentRelationship) GetUnpushed ¶ added in v1.0.362
func (t CheckComponentRelationship) GetUnpushed(db *gorm.DB) ([]DBTable, error)
func (CheckComponentRelationship) PK ¶ added in v1.0.362
func (c CheckComponentRelationship) PK() string
func (*CheckComponentRelationship) Save ¶ added in v1.0.253
func (c *CheckComponentRelationship) Save(db *gorm.DB) error
func (CheckComponentRelationship) TableName ¶ added in v1.0.77
func (CheckComponentRelationship) TableName() string
func (CheckComponentRelationship) UpdateIsPushed ¶ added in v1.0.362
func (s CheckComponentRelationship) UpdateIsPushed(db *gorm.DB, items []DBTable) error
type CheckConfigRelationship ¶ added in v1.0.235
type CheckConfigRelationship struct {
ConfigID uuid.UUID `json:"config_id,omitempty"`
CheckID uuid.UUID `json:"check_id,omitempty"`
CanaryID uuid.UUID `json:"canary_id,omitempty"`
SelectorID string `json:"selector_id,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
func (CheckConfigRelationship) GetUnpushed ¶ added in v1.0.362
func (c CheckConfigRelationship) GetUnpushed(db *gorm.DB) ([]DBTable, error)
func (CheckConfigRelationship) PK ¶ added in v1.0.362
func (c CheckConfigRelationship) PK() string
func (CheckConfigRelationship) PKCols ¶ added in v1.0.1211
func (c CheckConfigRelationship) PKCols() []clause.Column
func (*CheckConfigRelationship) Save ¶ added in v1.0.253
func (c *CheckConfigRelationship) Save(db *gorm.DB) error
func (CheckConfigRelationship) TableName ¶ added in v1.0.235
func (CheckConfigRelationship) TableName() string
func (CheckConfigRelationship) UpdateIsPushed ¶ added in v1.0.362
func (s CheckConfigRelationship) UpdateIsPushed(db *gorm.DB, items []DBTable) error
func (CheckConfigRelationship) Value ¶ added in v1.0.1211
func (c CheckConfigRelationship) Value() any
type CheckHealthStatus ¶ added in v1.0.60
type CheckHealthStatus string
func (CheckHealthStatus) Pretty ¶ added in v1.0.1168
func (c CheckHealthStatus) Pretty() api.Text
type CheckStatus ¶ added in v1.0.15
type CheckStatus struct {
CheckID uuid.UUID `json:"check_id" gorm:"primaryKey"`
Status bool `json:"status"`
Invalid bool `json:"invalid,omitempty"`
Time string `json:"time" gorm:"primaryKey"`
Duration int `json:"duration"`
Message string `json:"message,omitempty"`
Error string `json:"error,omitempty"`
Detail any `json:"-" gorm:"-"`
CreatedAt time.Time `json:"created_at,omitempty" gorm:"<-:create"`
// IsPushed when set to true indicates that the check status has been pushed to upstream.
IsPushed bool `json:"is_pushed,omitempty"`
}
func (CheckStatus) AsMap ¶ added in v1.0.172
func (s CheckStatus) AsMap(removeFields ...string) map[string]any
func (CheckStatus) GetUnpushed ¶ added in v1.0.362
func (s CheckStatus) GetUnpushed(db *gorm.DB) ([]DBTable, error)
func (CheckStatus) PK ¶ added in v1.0.362
func (s CheckStatus) PK() string
func (CheckStatus) PKCols ¶ added in v1.0.428
func (s CheckStatus) PKCols() []clause.Column
func (CheckStatus) Pretty ¶ added in v1.0.1168
func (c CheckStatus) Pretty() api.Text
func (CheckStatus) PrettyRow ¶ added in v1.0.1168
func (c CheckStatus) PrettyRow(opts interface{}) map[string]api.Text
func (CheckStatus) TableName ¶ added in v1.0.21
func (CheckStatus) TableName() string
func (CheckStatus) UpdateIsPushed ¶ added in v1.0.362
func (s CheckStatus) UpdateIsPushed(db *gorm.DB, items []DBTable) error
func (CheckStatus) UpdateParentsIsPushed ¶ added in v1.0.428
func (t CheckStatus) UpdateParentsIsPushed(db *gorm.DB, items []DBTable) error
func (CheckStatus) Value ¶ added in v1.0.428
func (t CheckStatus) Value() any
type CheckStatusAggregate1d ¶ added in v1.0.44
type CheckStatusAggregate1d struct {
CheckID string `gorm:"column:check_id"`
CreatedAt time.Time `gorm:"column:created_at"`
Duration int `gorm:"column:duration"`
Total int `gorm:"column:total"`
Passed int `gorm:"column:passed"`
Failed int `gorm:"column:failed"`
}
CheckStatusAggregate1d represents the `check_statuses_1d` table
func (CheckStatusAggregate1d) TableName ¶ added in v1.0.44
func (CheckStatusAggregate1d) TableName() string
type CheckStatusAggregate1h ¶ added in v1.0.44
type CheckStatusAggregate1h struct {
CheckID string `gorm:"column:check_id"`
CreatedAt time.Time `gorm:"column:created_at"`
Duration int `gorm:"column:duration"`
Total int `gorm:"column:total"`
Passed int `gorm:"column:passed"`
Failed int `gorm:"column:failed"`
}
CheckStatusAggregate1h represents the `check_statuses_1h` table
func (CheckStatusAggregate1h) TableName ¶ added in v1.0.44
func (CheckStatusAggregate1h) TableName() string
type CheckSummary ¶ added in v1.0.164
type CheckSummary struct {
ID uuid.UUID `json:"id"`
CanaryID uuid.UUID `json:"canary_id"`
CanaryName string `json:"canary_name"`
CanaryNamespace string `json:"canary_namespace"`
AgentID uuid.UUID `json:"agent_id"`
Description string `json:"description,omitempty"`
Icon string `json:"icon,omitempty"`
Labels types.JSONStringMap `json:"labels"`
LastTransitionTime *time.Time `json:"last_transition_time,omitempty"`
Latency types.Latency `json:"latency,omitempty"`
Name string `json:"name"`
Namespace string `json:"namespace"`
Owner string `json:"owner,omitempty"`
Severity string `json:"severity,omitempty"`
Status string `json:"status"`
Type string `json:"type"`
Uptime types.Uptime `json:"uptime,omitempty"`
LastRuntime *time.Time `json:"last_runtime,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
SilencedAt *time.Time `json:"silenced_at,omitempty"`
}
CheckSummary represents the `check_summary` view
func (CheckSummary) AsMap ¶ added in v1.0.175
func (t CheckSummary) AsMap(removeFields ...string) map[string]any
func (*CheckSummary) TableName ¶ added in v1.0.164
func (t *CheckSummary) TableName() string
type ChecksUnlogged ¶ added in v1.0.1093
type ChecksUnlogged struct {
CheckID uuid.UUID `json:"check_id" gorm:"primaryKey"`
CanaryID uuid.UUID `json:"canary_id"`
Status string `json:"status"`
LastRuntime *time.Time `json:"last_runtime,omitempty"`
NextRuntime *time.Time `json:"next_runtime,omitempty"`
}
func (ChecksUnlogged) GetUnpushed ¶ added in v1.0.1093
func (ChecksUnlogged) GetUnpushed(db *gorm.DB) ([]DBTable, error)
func (ChecksUnlogged) PK ¶ added in v1.0.1093
func (ChecksUnlogged) PK() string
func (ChecksUnlogged) TableName ¶ added in v1.0.1093
func (ChecksUnlogged) TableName() string
func (ChecksUnlogged) UpdateIsPushed ¶ added in v1.0.1093
func (ChecksUnlogged) UpdateIsPushed(db *gorm.DB, items []DBTable) error
func (ChecksUnlogged) UpdateParentsIsPushed ¶ added in v1.0.1093
func (ChecksUnlogged) UpdateParentsIsPushed(db *gorm.DB, items []DBTable) error
type ColumnType ¶ added in v1.0.983
type ColumnType string
const ( ColumnTypeBoolean ColumnType = "boolean" ColumnTypeDateTime ColumnType = "datetime" ColumnTypeDecimal ColumnType = "decimal" ColumnTypeDuration ColumnType = "duration" ColumnTypeInteger ColumnType = "integer" ColumnTypeJSONB ColumnType = "jsonb" ColumnTypeString ColumnType = "string" )
func (ColumnType) SQLiteType ¶ added in v1.0.999
func (t ColumnType) SQLiteType() string
type Comment ¶ added in v1.0.67
type Comment struct {
ID uuid.UUID `json:"id" gorm:"primaryKey"`
CreatedBy uuid.UUID `json:"created_by,omitempty"`
Comment string `json:"comment,omitempty"`
ExternalID *string `json:"external_id,omitempty"`
ExternalCreatedBy *string `json:"external_created_by,omitempty"`
IncidentID uuid.UUID `json:"incident_id,omitempty"`
ResponderID *uuid.UUID `json:"responder_id,omitempty"`
HypothesisID *uuid.UUID `json:"hypothesis_id,omitempty"`
Read []int16 `json:"read,omitempty" gorm:"type:smallint[]"`
CreatedAt time.Time `json:"created_at,omitempty" time_format:"postgres_timestamp" gorm:"default:CURRENT_TIMESTAMP()"`
UpdatedAt time.Time `json:"updated_at,omitempty" time_format:"postgres_timestamp" gorm:"default:CURRENT_TIMESTAMP()"`
}
type Component ¶ added in v1.0.15
type Component struct {
ID uuid.UUID `json:"id,omitempty" gorm:"default:generate_ulid()"` //nolint
TopologyID *uuid.UUID `json:"topology_id,omitempty"`
AgentID uuid.UUID `json:"agent_id,omitempty"`
ExternalId string `json:"external_id,omitempty"` //nolint
ParentId *uuid.UUID `json:"parent_id,omitempty"` //nolint
Name string `json:"name"`
Text string `json:"text,omitempty"`
TopologyType string `json:"topology_type,omitempty"`
Namespace string `json:"namespace"`
Labels types.JSONStringMap `json:"labels,omitempty" gorm:"default:null"`
Hidden bool `json:"hidden,omitempty"`
Silenced bool `json:"silenced,omitempty"`
Status types.ComponentStatus `json:"status"`
Health *Health `json:"health,omitempty"`
Description string `json:"description"`
Lifecycle string `json:"lifecycle,omitempty"`
LogSelectors types.LogSelectors `json:"logs,omitempty" gorm:"column:log_selectors;default:null"`
Tooltip string `json:"tooltip,omitempty"`
StatusReason string `json:"status_reason,omitempty" gorm:"default:null"`
Schedule string `json:"schedule,omitempty"`
Icon string `json:"icon,omitempty"`
Type string `json:"type"`
Owner string `json:"owner,omitempty"`
Selectors types.ResourceSelectors `json:"selectors,omitempty" gorm:"resourceSelectors;default:null" swaggerignore:"true"`
Configs types.ConfigQueries `json:"configs,omitempty" gorm:"default:null"`
ComponentChecks types.ComponentChecks `json:"componentChecks,omitempty" gorm:"default:null"`
Properties Properties `json:"properties,omitempty" gorm:"type:properties;default:null"`
Path string `json:"path,omitempty"`
Summary types.Summary `json:"summary,omitempty" gorm:"type:summary;default:null"`
IsLeaf bool `json:"is_leaf"`
CostPerMinute float64 `json:"cost_per_minute,omitempty" gorm:"column:cost_per_minute"`
CostTotal1d float64 `json:"cost_total_1d,omitempty" gorm:"column:cost_total_1d"`
CostTotal7d float64 `json:"cost_total_7d,omitempty" gorm:"column:cost_total_7d"`
CostTotal30d float64 `json:"cost_total_30d,omitempty" gorm:"column:cost_total_30d"`
CreatedBy *uuid.UUID `json:"created_by,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty" time_format:"postgres_timestamp" gorm:"default:CURRENT_TIMESTAMP();<-:create"`
UpdatedAt *time.Time `json:"updated_at,omitempty" time_format:"postgres_timestamp" gorm:"autoUpdateTime:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty" time_format:"postgres_timestamp" swaggerignore:"true"`
// ConfigID is the id of the config from which this component is derived
ConfigID *uuid.UUID `json:"config_id,omitempty"`
// StatusExpr allows defining a cel expression to evaluate the status of a component
// based on the summary.
StatusExpr string `json:"status_expr,omitempty" gorm:"column:status_expr;default:null"`
// HealthExpr allows defining a cel expression to evaluate the health of a component
// based on the summary.
HealthExpr string `json:"health_expr,omitempty" gorm:"column:health_expr;default:null"`
// Auxiliary fields
Checks map[string]int `json:"checks,omitempty" gorm:"-"`
Incidents map[string]map[string]int `json:"incidents,omitempty" gorm:"-"`
Analysis map[string]map[string]int `json:"analysis,omitempty" gorm:"-"`
Components Components `json:"components,omitempty" gorm:"-"`
Order int `json:"order,omitempty" gorm:"-"`
SelectorID string `json:"-" gorm:"-"`
RelationshipID *uuid.UUID `json:"relationship_id,omitempty" gorm:"-"`
Children []string `json:"children,omitempty" gorm:"-"`
Parents []string `json:"parents,omitempty" gorm:"-"`
// Mark it as true when the component is processed
// during topology tree creation
NodeProcessed bool `json:"-" gorm:"-"`
}
func (Component) GetAgentID ¶ added in v1.0.1064
func (Component) GetAsEnvironment ¶ added in v1.0.49
func (Component) GetFieldsMatcher ¶ added in v1.0.401
func (Component) GetHealthDescription ¶ added in v1.0.930
func (Component) GetLabelsMatcher ¶ added in v1.0.401
func (Component) GetNamespace ¶ added in v1.0.397
func (Component) GetTrimmedLabels ¶ added in v1.0.981
func (Component) GetUnpushed ¶ added in v1.0.362
func (*Component) ObjectMeta ¶ added in v1.0.253
func (c *Component) ObjectMeta() metav1.ObjectMeta
func (Component) QueryLogSummary ¶ added in v1.0.1230
type ComponentRelationship ¶ added in v1.0.15
type ComponentRelationship struct {
ComponentID uuid.UUID `json:"component_id,omitempty" gorm:"primaryKey"`
RelationshipID uuid.UUID `json:"relationship_id,omitempty" gorm:"primaryKey"`
SelectorID string `json:"selector_id,omitempty" gorm:"primaryKey"`
RelationshipPath string `json:"relationship_path,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty" gorm:"autoUpdateTime:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
func (ComponentRelationship) GetUnpushed ¶ added in v1.0.362
func (cr ComponentRelationship) GetUnpushed(db *gorm.DB) ([]DBTable, error)
func (ComponentRelationship) PK ¶ added in v1.0.362
func (cr ComponentRelationship) PK() string
func (ComponentRelationship) PKCols ¶ added in v1.0.428
func (s ComponentRelationship) PKCols() []clause.Column
func (ComponentRelationship) TableName ¶ added in v1.0.15
func (ComponentRelationship) TableName() string
func (ComponentRelationship) UpdateIsPushed ¶ added in v1.0.362
func (s ComponentRelationship) UpdateIsPushed(db *gorm.DB, items []DBTable) error
func (ComponentRelationship) UpdateParentsIsPushed ¶ added in v1.0.428
func (s ComponentRelationship) UpdateParentsIsPushed(db *gorm.DB, items []DBTable) error
func (ComponentRelationship) Value ¶ added in v1.0.428
func (s ComponentRelationship) Value() any
type Components ¶ added in v1.0.15
type Components []*Component
func (Components) Debug ¶ added in v1.0.83
func (components Components) Debug(prefix string) string
func (Components) Find ¶ added in v1.0.83
func (components Components) Find(name string) *Component
func (Components) Map ¶ added in v1.0.25
func (components Components) Map(fn func(c *Component))
func (Components) Summarize ¶ added in v1.0.83
func (components Components) Summarize(depth int) types.Summary
func (Components) Walk ¶ added in v1.0.83
func (components Components) Walk() Components
type ConfigAccess ¶ added in v1.0.937
type ConfigAccess struct {
ID string `json:"id" gorm:"not null"`
ApplicationID *uuid.UUID `json:"application_id" gorm:"default:null"`
ScraperID *uuid.UUID `json:"scraper_id" gorm:"default:null"`
Source *string `json:"source" gorm:"default:null"`
ConfigID uuid.UUID `json:"config_id"`
ExternalUserID *uuid.UUID `json:"external_user_id,omitempty"`
ExternalGroupID *uuid.UUID `json:"external_group_id,omitempty"`
ExternalRoleID *uuid.UUID `json:"external_role_id,omitempty"`
CreatedAt time.Time `json:"created_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
DeletedBy *uuid.UUID `json:"deleted_by,omitempty"`
CreatedBy *uuid.UUID `json:"created_by,omitempty"`
LastReviewedAt *time.Time `json:"last_reviewed_at,omitempty"`
LastReviewedBy *uuid.UUID `json:"last_reviewed_by,omitempty"`
}
func (ConfigAccess) PK ¶ added in v1.0.937
func (e ConfigAccess) PK() string
func (ConfigAccess) TableName ¶ added in v1.0.937
func (e ConfigAccess) TableName() string
type ConfigAccessLog ¶ added in v1.0.944
type ConfigAccessLog struct {
ConfigID uuid.UUID `json:"config_id" gorm:"primaryKey"`
ExternalUserID uuid.UUID `json:"external_user_id" gorm:"primaryKey"`
ScraperID uuid.UUID `json:"scraper_id" gorm:"primaryKey"`
CreatedAt time.Time `json:"created_at"`
MFA bool `json:"mfa,omitempty" gorm:"default:null"`
Properties types.JSONMap `json:"properties,omitempty" gorm:"default:null"`
Count *int `json:"count,omitempty" gorm:"default:1"`
}
func (ConfigAccessLog) TableName ¶ added in v1.0.944
func (e ConfigAccessLog) TableName() string
type ConfigAccessSummary ¶ added in v1.0.944
type ConfigAccessSummary struct {
ConfigID uuid.UUID `json:"config_id"`
ConfigName string `json:"config_name"`
ConfigType string `json:"config_type"`
ExternalGroupID *uuid.UUID `json:"external_group_id,omitempty"`
ExternalUserID uuid.UUID `json:"external_user_id,omitempty"`
Role string `json:"role"`
RoleExternalIDs pq.StringArray `json:"role_external_ids,omitempty" gorm:"type:[]text"`
User string `json:"user"`
UserType string `json:"user_type"`
Email string `json:"email"`
CreatedAt time.Time `json:"created_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
CreatedBy *uuid.UUID `json:"created_by,omitempty"`
LastSignedInAt *time.Time `json:"last_signed_in_at,omitempty"`
LastReviewedAt *time.Time `json:"last_reviewed_at,omitempty"`
LastReviewedBy *uuid.UUID `json:"last_reviewed_by,omitempty"`
}
func (ConfigAccessSummary) QueryLogSummary ¶ added in v1.0.1247
func (e ConfigAccessSummary) QueryLogSummary() string
func (ConfigAccessSummary) TableName ¶ added in v1.0.944
func (e ConfigAccessSummary) TableName() string
type ConfigAnalysis ¶ added in v1.0.5
type ConfigAnalysis struct {
ID uuid.UUID `gorm:"primaryKey;unique_index;not null;column:id;default:generate_ulid()" json:"id"`
ExternalID string `gorm:"-"`
ConfigType string `gorm:"-"`
ConfigID uuid.UUID `gorm:"column:config_id;default:''" json:"config_id"`
ScraperID *uuid.UUID `gorm:"column:scraper_id;default:null" json:"scraper_id"`
Analyzer string `gorm:"column:analyzer" json:"analyzer" faker:"oneof: ec2-instance-no-public-ip, eks-endpoint-no-public-access"`
Message string `gorm:"column:message" json:"message"`
Summary string `gorm:"column:summary;default:null" json:"summary,omitempty"`
Status string `gorm:"column:status;default:null" json:"status,omitempty" faker:"oneof: open, resolved, silenced"`
Severity Severity `gorm:"column:severity" json:"severity" faker:"oneof: critical, high, medium, low, info"`
AnalysisType AnalysisType `gorm:"column:analysis_type" json:"analysis_type" faker:"oneof: availability, compliance, cost, security, performance"`
Analysis types.JSONMap `gorm:"column:analysis" json:"analysis,omitempty"`
Properties *types.Properties `gorm:"column:properties;default:null" json:"properties,omitempty"`
Source string `gorm:"column:source" json:"source,omitempty"`
FirstObserved *time.Time `gorm:"column:first_observed;default:now();<-:create" json:"first_observed"`
// LastObserved is the timestamp the sraper last observed this analysis
LastObserved *time.Time `gorm:"column:last_observed;default:no()" json:"last_observed"`
// IsPushed when set to true indicates that the check status has been pushed to upstream.
IsPushed bool `json:"is_pushed,omitempty"`
}
func (ConfigAnalysis) GetUnpushed ¶ added in v1.0.362
func (ConfigAnalysis) GetUnpushed(db *gorm.DB) ([]DBTable, error)
func (ConfigAnalysis) PK ¶ added in v1.0.362
func (a ConfigAnalysis) PK() string
func (ConfigAnalysis) PKCols ¶ added in v1.0.428
func (c ConfigAnalysis) PKCols() []clause.Column
func (ConfigAnalysis) Pretty ¶ added in v1.0.1168
func (c ConfigAnalysis) Pretty() api.Text
func (ConfigAnalysis) PrettyRow ¶ added in v1.0.1168
func (c ConfigAnalysis) PrettyRow(opts interface{}) map[string]api.Text
func (ConfigAnalysis) QueryLogSummary ¶ added in v1.0.1247
func (a ConfigAnalysis) QueryLogSummary() string
func (ConfigAnalysis) String ¶ added in v1.0.5
func (a ConfigAnalysis) String() string
func (ConfigAnalysis) TableName ¶ added in v1.0.5
func (a ConfigAnalysis) TableName() string
func (ConfigAnalysis) UpdateParentsIsPushed ¶ added in v1.0.428
func (t ConfigAnalysis) UpdateParentsIsPushed(db *gorm.DB, items []DBTable) error
func (ConfigAnalysis) Value ¶ added in v1.0.428
func (c ConfigAnalysis) Value() any
type ConfigChange ¶ added in v1.0.5
type ConfigChange struct {
// ExternalID is the external identifier for the configuration change.
// Note: This field is not stored in the database.
ExternalID string `gorm:"-" json:"-"`
// ConfigType represents the type of configuration.
// Note: This field is not stored in the database.
ConfigType string `gorm:"-" json:"-"`
// Action describes the pipeline lifecycle action taken for this change
// (e.g. inserted, updated, unchanged, move-up, copy-up, move, copy).
// Note: This field is not stored in the database.
Action string `gorm:"-" json:"action,omitempty"`
// ExternalChangeID is the identifier for the change from an external system.
ExternalChangeID *string `gorm:"column:external_change_id;default:null" json:"external_change_id"`
// ID is the unique identifier for the configuration change.
// It is automatically generated using ULID if not provided.
ID string `gorm:"primaryKey;unique_index;not null;column:id;default:generate_ulid()" json:"id"`
// ConfigID is the identifier of the associated configuration item.
ConfigID string `gorm:"column:config_id;default:''" json:"config_id"`
// ChangeType describes the nature of the configuration change.
// Example values: RunInstances, diff
ChangeType string `gorm:"column:change_type" json:"change_type" faker:"oneof: RunInstances, diff" `
// Severity indicates the importance or impact level of the change.
// Possible values: critical, high, medium, low, info
Severity Severity `json:"severity" faker:"oneof: critical, high, medium, low, info"`
// Source indicates the origin of the configuration change, e.g. Kubernetes, Cloudtrail
Source string `json:"source"`
// Summary provides a brief description of the change.
Summary string `json:"summary,omitempty"`
// Patches contains a JSON strategic merge patch
Patches string `gorm:"column:patches;default:null" json:"patches,omitempty"`
// Diff represents the differences introduced by this change.
Diff *string `gorm:"column:diff;default:null" json:"diff,omitempty"`
// Fingerprint is a uniquest identifier for the change, it ignores all UUID, numbers and timestamps to enable de-duplication of equivalent changes.
Fingerprint *string `gorm:"column:fingerprint;default:null" json:"fingerprint,omitempty"`
// Details contains additional information about the change in JSON format.
Details types.JSON `json:"details,omitempty"`
// CreatedAt represents the timestamp when the change was created or last observed
CreatedAt *time.Time `json:"created_at"`
// FirstObserved represents the timestamp when this change was first observed.
FirstObserved *time.Time `gorm:"first_observed;default:now()" json:"first_observed,omitempty"`
// Count is the number of occurrences of this change, including duplicates detected by fingerprinting
Count int `json:"count"`
// IsPushed indicates whether the change has been pushed to upstream.
// When set to true, it means the status has been synchronized.
IsPushed bool `json:"is_pushed,omitempty"`
// CreatedBy is the UUID of the local user who created this change.
CreatedBy *uuid.UUID `gorm:"column:created_by" json:"created_by,omitempty"`
// ExternalCreatedBy is the name/email from the external system that created this change.
ExternalCreatedBy *string `gorm:"column:external_created_by" json:"external_created_by,omitempty"`
// Artifacts associated with this change (screenshots, HAR files, etc.)
Artifacts []Artifact `gorm:"foreignKey:ConfigChangeID" json:"artifacts,omitempty"`
}
ConfigChange represents the config change database table ConfigChange represents a change to a configuration item.
func (*ConfigChange) BeforeCreate ¶ added in v1.0.64
func (c *ConfigChange) BeforeCreate(tx *gorm.DB) error
BeforeCreate is a user defined hook for Gorm. It will be called when creating a record.
func (ConfigChange) Columns ¶ added in v1.0.1193
func (c ConfigChange) Columns() []api.ColumnDef
func (ConfigChange) GetExternalID ¶ added in v1.0.5
func (c ConfigChange) GetExternalID() ExternalID
func (ConfigChange) GetUnpushed ¶ added in v1.0.362
func (t ConfigChange) GetUnpushed(db *gorm.DB) ([]DBTable, error)
func (ConfigChange) PK ¶ added in v1.0.362
func (c ConfigChange) PK() string
func (ConfigChange) PKCols ¶ added in v1.0.428
func (c ConfigChange) PKCols() []clause.Column
func (ConfigChange) Pretty ¶ added in v1.0.1168
func (c ConfigChange) Pretty() api.Text
func (ConfigChange) PrettyRow ¶ added in v1.0.1168
func (c ConfigChange) PrettyRow(opts interface{}) map[string]api.Text
func (ConfigChange) Row ¶ added in v1.0.1193
func (c ConfigChange) Row() map[string]any
func (ConfigChange) RowDetail ¶ added in v1.0.1230
func (c ConfigChange) RowDetail() api.Textable
func (ConfigChange) String ¶ added in v1.0.5
func (c ConfigChange) String() string
func (ConfigChange) TableName ¶ added in v1.0.5
func (c ConfigChange) TableName() string
func (ConfigChange) UpdateParentsIsPushed ¶ added in v1.0.428
func (t ConfigChange) UpdateParentsIsPushed(db *gorm.DB, items []DBTable) error
func (ConfigChange) Value ¶ added in v1.0.428
func (c ConfigChange) Value() any
type ConfigChangeUpdate ¶ added in v1.0.1308
type ConfigChangeUpdate struct {
Change *ConfigChange
CountIncrement int
FirstInBatch bool // First occurrence in current batch (not found in cache)
}
ConfigChangeUpdate represents an existing config change that should be updated instead of inserting a duplicate.
type ConfigComponentRelationship ¶ added in v1.0.15
type ConfigComponentRelationship struct {
ComponentID uuid.UUID `json:"component_id,omitempty" gorm:"primaryKey"`
ConfigID uuid.UUID `json:"config_id,omitempty" gorm:"primaryKey"`
SelectorID string `json:"selector_id,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty" gorm:"autoUpdateTime:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
func (ConfigComponentRelationship) GetUnpushed ¶ added in v1.0.362
func (t ConfigComponentRelationship) GetUnpushed(db *gorm.DB) ([]DBTable, error)
func (ConfigComponentRelationship) PK ¶ added in v1.0.362
func (t ConfigComponentRelationship) PK() string
func (ConfigComponentRelationship) PKCols ¶ added in v1.0.428
func (s ConfigComponentRelationship) PKCols() []clause.Column
func (ConfigComponentRelationship) TableName ¶ added in v1.0.15
func (ConfigComponentRelationship) TableName() string
func (ConfigComponentRelationship) UpdateIsPushed ¶ added in v1.0.362
func (s ConfigComponentRelationship) UpdateIsPushed(db *gorm.DB, items []DBTable) error
func (ConfigComponentRelationship) UpdateParentsIsPushed ¶ added in v1.0.428
func (s ConfigComponentRelationship) UpdateParentsIsPushed(db *gorm.DB, items []DBTable) error
func (ConfigComponentRelationship) Value ¶ added in v1.0.428
func (s ConfigComponentRelationship) Value() any
type ConfigCost ¶ added in v1.0.1367
type ConfigCost struct {
types.NoOpResourceSelectable `json:"-"`
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
ConfigID uuid.UUID `json:"config_id"`
ScraperID *uuid.UUID `json:"scraper_id,omitempty"`
SourceKey string `json:"source_key"`
ExternalID *string `json:"external_id,omitempty"`
ExternalConfigType *string `json:"external_config_type,omitempty"`
ExternalConfigScraperID *string `json:"external_config_scraper_id,omitempty"`
ExternalConfigLabels types.JSONMap `json:"external_config_labels,omitempty" gorm:"type:jsonb"`
PeriodStart time.Time `json:"period_start"`
PeriodEnd time.Time `json:"period_end"`
Grain string `json:"grain"`
ChargeCategory string `json:"charge_category"`
ChargeClass *string `json:"charge_class,omitempty"`
ServiceName *string `json:"service_name,omitempty"`
ServiceCategory *string `json:"service_category,omitempty"`
SkuID *string `json:"sku_id,omitempty"`
RegionID *string `json:"region_id,omitempty"`
BillingCurrency string `json:"billing_currency"`
BilledCost decimal.Decimal `json:"billed_cost"`
EffectiveCost decimal.Decimal `json:"effective_cost"`
ListCost *decimal.Decimal `json:"list_cost,omitempty"`
ContractedCost *decimal.Decimal `json:"contracted_cost,omitempty"`
PricingQuantity *decimal.Decimal `json:"pricing_quantity,omitempty"`
PricingUnit *string `json:"pricing_unit,omitempty"`
// Focus holds every dimension without a dedicated column: the FOCUS long tail
// (Tags, SkuPriceDetails, CommitmentDiscount*, ...), all x_* custom columns, and the
// demoted billing_account_id / sub_account_id.
//
// Demoted here does not mean demoted out of identity — the fingerprint still reads
// the account keys back out by name, so spend from two sub-accounts never merges.
Focus types.JSONMap `json:"focus,omitempty" gorm:"type:jsonb"`
// Fingerprint is a deterministic hash of the dimension tuple. Together with
// (source_key, config_id, period_start, period_end) it is the merge key.
Fingerprint string `json:"fingerprint"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
ConfigCost is one cost line item, already merged to its bucket grain, shaped on FOCUS v1.4. The period is half-open: [PeriodStart, PeriodEnd), always UTC.
ConfigID is always set. Spend with no resource of its own — tax, support, credits, or a resource the scraper could not resolve — is attributed by the emitting scraper to its root config item (AWS::::Account, GCP::Project, ...). ExternalID is kept as provenance so the original resource identifier is still visible on the row.
func (ConfigCost) GetFieldsMatcher ¶ added in v1.0.1367
func (c ConfigCost) GetFieldsMatcher() fields.Fields
func (ConfigCost) GetID ¶ added in v1.0.1367
func (c ConfigCost) GetID() string
func (ConfigCost) GetName ¶ added in v1.0.1367
func (c ConfigCost) GetName() string
func (ConfigCost) GetType ¶ added in v1.0.1367
func (c ConfigCost) GetType() string
func (ConfigCost) PK ¶ added in v1.0.1367
func (c ConfigCost) PK() string
func (ConfigCost) TableName ¶ added in v1.0.1367
func (ConfigCost) TableName() string
type ConfigCostCompact ¶ added in v1.0.1367
type ConfigCostCompact struct {
ConfigCost
}
ConfigCostCompact is the queryable cost series derived from config_costs, carrying every grain. Identical shape, so compaction is a plain INSERT ... SELECT.
func (ConfigCostCompact) TableName ¶ added in v1.0.1367
func (ConfigCostCompact) TableName() string
type ConfigCostSummary ¶ added in v1.0.1367
type ConfigCostSummary struct {
ConfigID uuid.UUID `json:"config_id" gorm:"column:config_id"`
BillingCurrency string `json:"billing_currency" gorm:"column:billing_currency"`
Cost1h decimal.Decimal `json:"cost_1h" gorm:"column:cost_1h"`
Cost1d decimal.Decimal `json:"cost_1d" gorm:"column:cost_1d"`
Cost30d decimal.Decimal `json:"cost_30d" gorm:"column:cost_30d"`
Billed30d decimal.Decimal `json:"billed_30d" gorm:"column:billed_30d"`
LastCostAt time.Time `json:"last_cost_at" gorm:"column:last_cost_at"`
}
ConfigCostSummary is the config_cost_summary materialized view: trailing-window totals per config item and currency, refreshed by refresh_config_cost_summary(). Read only.
Column names are spelled out because gorm's naming strategy renders Cost30d as "cost30d", which silently binds nothing.
func (ConfigCostSummary) TableName ¶ added in v1.0.1367
func (ConfigCostSummary) TableName() string
type ConfigItem ¶ added in v1.0.5
type ConfigItem struct {
ID uuid.UUID `json:"id" faker:"uuid_hyphenated" gorm:"default:generate_ulid()"`
ScraperID *string `json:"scraper_id,omitempty"`
AgentID uuid.UUID `json:"agent_id,omitempty"`
ConfigClass string `json:"config_class" faker:"oneof:File,EC2Instance,KubernetesPod" `
ExternalID pq.StringArray `gorm:"type:[]text" json:"external_id,omitempty"`
Type *string `json:"type"`
Status *string `json:"status" gorm:"default:null"`
Ready bool `json:"ready"`
Health *Health `json:"health"`
Name *string `json:"name,omitempty" faker:"name"`
Description *string `json:"description"`
Config *string `json:"config"`
Source *string `json:"source,omitempty"`
ParentID *uuid.UUID `json:"parent_id,omitempty" faker:"-"`
Path string `json:"path,omitempty" faker:"-"`
Labels *types.JSONStringMap `json:"labels,omitempty" faker:"labels"`
Tags types.JSONStringMap `json:"tags,omitempty" faker:"tags"`
Properties *types.Properties `json:"properties,omitempty"`
CreatedAt time.Time `json:"created_at" gorm:"<-:create"`
InsertedAt time.Time `json:"inserted_at" gorm:"->;default:now()"`
UpdatedAt *time.Time `json:"updated_at" gorm:"autoUpdateTime:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
DeleteReason string `json:"delete_reason,omitempty"`
// contains filtered or unexported fields
}
ConfigItem represents the config item database table
func (ConfigItem) AsMap ¶ added in v1.0.175
func (ci ConfigItem) AsMap(removeFields ...string) map[string]any
func (ConfigItem) Clone ¶ added in v1.0.1293
func (config ConfigItem) Clone() ConfigItem
func (*ConfigItem) ConfigJSONStringMap ¶ added in v1.0.5
func (ci *ConfigItem) ConfigJSONStringMap() (map[string]any, error)
func (*ConfigItem) FromMap ¶ added in v1.0.957
func (ci *ConfigItem) FromMap(data map[string]any) error
func (ConfigItem) GetAgentID ¶ added in v1.0.1064
func (c ConfigItem) GetAgentID() string
func (ConfigItem) GetFieldsMatcher ¶ added in v1.0.401
func (c ConfigItem) GetFieldsMatcher() fields.Fields
func (ConfigItem) GetHealth ¶ added in v1.0.781
func (c ConfigItem) GetHealth() (string, error)
func (ConfigItem) GetHealthDescription ¶ added in v1.0.930
func (c ConfigItem) GetHealthDescription() string
func (ConfigItem) GetID ¶ added in v1.0.374
func (c ConfigItem) GetID() string
func (ConfigItem) GetLabels ¶ added in v1.0.374
func (t ConfigItem) GetLabels() map[string]string
func (ConfigItem) GetLabelsMatcher ¶ added in v1.0.401
func (c ConfigItem) GetLabelsMatcher() labels.Labels
func (ConfigItem) GetName ¶ added in v1.0.374
func (c ConfigItem) GetName() string
func (ConfigItem) GetNamespace ¶ added in v1.0.374
func (c ConfigItem) GetNamespace() string
func (ConfigItem) GetSelectorID ¶ added in v1.0.83
func (c ConfigItem) GetSelectorID() string
func (ConfigItem) GetStatus ¶ added in v1.0.374
func (c ConfigItem) GetStatus() (string, error)
func (ConfigItem) GetTags ¶ added in v1.0.826
func (t ConfigItem) GetTags() map[string]string
func (ConfigItem) GetTagsMatcher ¶ added in v1.0.412
func (c ConfigItem) GetTagsMatcher() labels.Labels
func (ConfigItem) GetTrimmedLabels ¶ added in v1.0.981
func (t ConfigItem) GetTrimmedLabels() []Label
func (ConfigItem) GetType ¶ added in v1.0.374
func (c ConfigItem) GetType() string
func (ConfigItem) GetUnpushed ¶ added in v1.0.362
func (t ConfigItem) GetUnpushed(db *gorm.DB) ([]DBTable, error)
func (*ConfigItem) NestedString ¶ added in v1.0.660
func (ci *ConfigItem) NestedString(paths ...string) string
func (ConfigItem) PK ¶ added in v1.0.347
func (t ConfigItem) PK() string
func (ConfigItem) PKCols ¶ added in v1.0.536
func (t ConfigItem) PKCols() []clause.Column
func (ConfigItem) Pretty ¶ added in v1.0.1168
func (c ConfigItem) Pretty() api.Text
func (ConfigItem) PrettyRow ¶ added in v1.0.1168
func (c ConfigItem) PrettyRow(opts interface{}) map[string]api.Text
func (ConfigItem) QueryLogSummary ¶ added in v1.0.1230
func (c ConfigItem) QueryLogSummary() string
func (*ConfigItem) SetParent ¶ added in v1.0.5
func (ci *ConfigItem) SetParent(parent *ConfigItem)
func (ConfigItem) String ¶ added in v1.0.5
func (ci ConfigItem) String() string
func (ConfigItem) TableName ¶ added in v1.0.5
func (ConfigItem) TableName() string
func (ConfigItem) UpdateParentsIsPushed ¶ added in v1.0.428
func (t ConfigItem) UpdateParentsIsPushed(db *gorm.DB, items []DBTable) error
func (ConfigItem) Value ¶ added in v1.0.536
func (c ConfigItem) Value() any
type ConfigItemLastScrapedTime ¶ added in v1.0.1085
type ConfigItemLastScrapedTime struct {
ConfigID uuid.UUID `json:"config_id" gorm:"primaryKey"`
LastScrapedTime *time.Time `json:"last_scraped_time,omitempty"`
}
func (ConfigItemLastScrapedTime) GetUnpushed ¶ added in v1.0.1093
func (ConfigItemLastScrapedTime) GetUnpushed(db *gorm.DB) ([]DBTable, error)
func (ConfigItemLastScrapedTime) PK ¶ added in v1.0.1093
func (c ConfigItemLastScrapedTime) PK() string
func (ConfigItemLastScrapedTime) PKCols ¶ added in v1.0.1249
func (ConfigItemLastScrapedTime) PKCols() []clause.Column
func (ConfigItemLastScrapedTime) TableName ¶ added in v1.0.1085
func (ConfigItemLastScrapedTime) TableName() string
func (ConfigItemLastScrapedTime) UpdateIsPushed ¶ added in v1.0.1093
func (ConfigItemLastScrapedTime) UpdateIsPushed(db *gorm.DB, items []DBTable) error
func (ConfigItemLastScrapedTime) UpdateParentsIsPushed ¶ added in v1.0.1093
func (ConfigItemLastScrapedTime) UpdateParentsIsPushed(db *gorm.DB, items []DBTable) error
func (ConfigItemLastScrapedTime) Value ¶ added in v1.0.1249
func (c ConfigItemLastScrapedTime) Value() any
type ConfigItemSummary ¶ added in v1.0.1004
type ConfigItemSummary struct {
ID uuid.UUID `json:"id" gorm:"primaryKey"`
ScraperID *string `json:"scraper_id,omitempty"`
ConfigClass string `json:"config_class"`
ExternalID pq.StringArray `gorm:"type:[]text" json:"external_id,omitempty"`
Type *string `json:"type"`
Name *string `json:"name,omitempty"`
Namespace *string `json:"namespace,omitempty"`
Description *string `json:"description"`
Source *string `json:"source,omitempty"`
Labels *types.JSONStringMap `json:"labels,omitempty"`
Tags types.JSONStringMap `json:"tags,omitempty"`
CreatedBy *uuid.UUID `json:"created_by,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
CostPerMinute *float64 `gorm:"column:cost_per_minute" json:"cost_per_minute,omitempty"`
CostTotal1h *float64 `gorm:"column:cost_total_1h" json:"cost_total_1h,omitempty"`
CostTotal1d *float64 `gorm:"column:cost_total_1d" json:"cost_total_1d,omitempty"`
CostTotal30d *float64 `gorm:"column:cost_total_30d" json:"cost_total_30d,omitempty"`
BillingCurrency *string `gorm:"column:billing_currency" json:"billing_currency,omitempty"`
MixedCurrency bool `gorm:"column:mixed_currency" json:"mixed_currency"`
AgentID uuid.UUID `json:"agent_id,omitempty"`
Status *string `json:"status"`
Health *Health `json:"health"`
Ready bool `json:"ready"`
Path string `json:"path,omitempty"`
Changes int `json:"changes,omitempty"`
Analysis *types.JSONMap `json:"analysis,omitempty"`
}
ConfigItemSummary represents the configs view
func (ConfigItemSummary) GetAgentID ¶ added in v1.0.1064
func (c ConfigItemSummary) GetAgentID() string
func (ConfigItemSummary) TableName ¶ added in v1.0.1004
func (ConfigItemSummary) TableName() string
func (ConfigItemSummary) ToConfigItem ¶ added in v1.0.1021
func (c ConfigItemSummary) ToConfigItem() ConfigItem
type ConfigLocation ¶ added in v1.0.1020
ConfigLocation represents the config_locations database table
type ConfigRelationship ¶ added in v1.0.5
type ConfigRelationship struct {
ConfigID string `json:"config_id"`
RelatedID string `json:"related_id"`
Relation string `json:"relation"`
// ScraperID identifies the scraper that owns this relationship.
ScraperID *uuid.UUID `json:"scraper_id"`
SelectorID string `json:"selector_id"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty" gorm:"autoUpdateTime:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
func (ConfigRelationship) GetUnpushed ¶ added in v1.0.362
func (t ConfigRelationship) GetUnpushed(db *gorm.DB) ([]DBTable, error)
func (ConfigRelationship) PK ¶ added in v1.0.362
func (cr ConfigRelationship) PK() string
func (ConfigRelationship) PKCols ¶ added in v1.0.428
func (c ConfigRelationship) PKCols() []clause.Column
func (ConfigRelationship) TableName ¶ added in v1.0.5
func (cr ConfigRelationship) TableName() string
func (ConfigRelationship) UpdateIsPushed ¶ added in v1.0.362
func (s ConfigRelationship) UpdateIsPushed(db *gorm.DB, items []DBTable) error
func (ConfigRelationship) UpdateParentsIsPushed ¶ added in v1.0.428
func (t ConfigRelationship) UpdateParentsIsPushed(db *gorm.DB, items []DBTable) error
func (ConfigRelationship) Value ¶ added in v1.0.428
func (c ConfigRelationship) Value() any
type ConfigScraper ¶ added in v1.0.53
type ConfigScraper struct {
ID uuid.UUID `json:"id"`
AgentID uuid.UUID `json:"agent_id,omitempty"`
Name string `json:"name"`
Namespace string `json:"namespace"`
Description string `json:"description,omitempty"`
Spec string `json:"spec,omitempty"`
Source string `json:"source,omitempty"`
ApplicationID *uuid.UUID `json:"application_id,omitempty" gorm:"default:null"`
CreatedBy *uuid.UUID `json:"created_by,omitempty"`
CreatedAt time.Time `json:"created_at" gorm:"<-:create"`
UpdatedAt *time.Time `json:"updated_at" gorm:"autoUpdateTime:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
ConfigScraper represents the config_scrapers database table
func FindScraperByConfigId ¶ added in v1.0.920
func FindScraperByConfigId(db *gorm.DB, configId string) (*ConfigScraper, error)
func (ConfigScraper) AsMap ¶ added in v1.0.175
func (c ConfigScraper) AsMap(removeFields ...string) map[string]any
func (*ConfigScraper) BeforeCreate ¶ added in v1.0.53
func (cs *ConfigScraper) BeforeCreate(tx *gorm.DB) error
BeforeCreate GORM hook
func (ConfigScraper) GetAgentID ¶ added in v1.0.1064
func (c ConfigScraper) GetAgentID() string
func (ConfigScraper) GetNamespace ¶ added in v1.0.894
func (c ConfigScraper) GetNamespace() string
func (ConfigScraper) GetUnpushed ¶ added in v1.0.362
func (c ConfigScraper) GetUnpushed(db *gorm.DB) ([]DBTable, error)
func (ConfigScraper) PK ¶ added in v1.0.362
func (c ConfigScraper) PK() string
func (ConfigScraper) TableName ¶ added in v1.0.53
func (c ConfigScraper) TableName() string
type Connection ¶ added in v1.0.45
type Connection struct {
ID uuid.UUID `gorm:"primaryKey;unique_index;not null;column:id;default:generate_ulid()" json:"id" faker:"uuid_hyphenated" `
Name string `gorm:"column:name" json:"name" faker:"name" `
Namespace string `gorm:"column:namespace" json:"namespace"`
Source string `json:"source"`
Type string `gorm:"column:type" json:"type" faker:"oneof: postgres, mysql, aws, gcp, http" `
URL string `gorm:"column:url" json:"url,omitempty" faker:"url" template:"true"`
Username string `gorm:"column:username" json:"username,omitempty" faker:"username" `
Password string `gorm:"column:password" json:"password,omitempty" faker:"password" `
Properties types.JSONStringMap `gorm:"column:properties" json:"properties,omitempty" faker:"-" template:"true"`
Certificate string `gorm:"column:certificate" json:"certificate,omitempty" faker:"-" `
InsecureTLS bool `gorm:"column:insecure_tls;default:false" json:"insecure_tls,omitempty" faker:"-" `
CreatedAt time.Time `gorm:"column:created_at;default:now();<-:create" json:"created_at,omitempty" faker:"-" `
UpdatedAt time.Time `gorm:"column:updated_at;default:now()" json:"updated_at,omitempty" faker:"-" `
CreatedBy *uuid.UUID `gorm:"column:created_by" json:"created_by,omitempty" faker:"-" `
}
func ConnectionFromURL ¶ added in v1.0.216
func ConnectionFromURL(url url.URL) *Connection
func (Connection) AsEnv ¶ added in v1.0.200
func (c Connection) AsEnv(ctx context.Context) EnvPrep
AsEnv generates environment variables and a configuration file content based on the connection type.
func (Connection) AsGoGetterURL ¶ added in v1.0.200
func (c Connection) AsGoGetterURL() (string, error)
AsGoGetterURL returns the connection as a url that's supported by https://github.com/hashicorp/go-getter Connection details are added to the url as query params
func (Connection) AsMap ¶ added in v1.0.175
func (c Connection) AsMap(removeFields ...string) map[string]any
func (*Connection) GetFieldsMatcher ¶ added in v1.0.853
func (c *Connection) GetFieldsMatcher() fields.Fields
func (*Connection) GetHealth ¶ added in v1.0.853
func (c *Connection) GetHealth() (string, error)
func (*Connection) GetID ¶ added in v1.0.853
func (c *Connection) GetID() string
func (*Connection) GetLabelsMatcher ¶ added in v1.0.853
func (c *Connection) GetLabelsMatcher() labels.Labels
func (*Connection) GetName ¶ added in v1.0.853
func (c *Connection) GetName() string
func (*Connection) GetNamespace ¶ added in v1.0.853
func (c *Connection) GetNamespace() string
func (*Connection) GetStatus ¶ added in v1.0.853
func (c *Connection) GetStatus() (string, error)
func (*Connection) GetType ¶ added in v1.0.853
func (c *Connection) GetType() string
func (Connection) Merge ¶ added in v1.0.213
func (c Connection) Merge(ctx types.GetEnvVarFromCache, from any) (*Connection, error)
func (Connection) PK ¶ added in v1.0.561
func (c Connection) PK() string
func (*Connection) SetProperty ¶ added in v1.0.605
func (c *Connection) SetProperty(key, value string)
func (Connection) String ¶ added in v1.0.48
func (c Connection) String() string
func (Connection) TableName ¶ added in v1.0.561
func (c Connection) TableName() string
type Contextable ¶ added in v1.0.564
type Deleteable ¶ added in v1.0.561
type EnvPrep ¶ added in v1.0.200
type EnvPrep struct {
// Env is the connection credentials in environment variables
Env []string
// CmdEnvs is a list of env vars that will be passed to the command
CmdEnvs []string
// List of commands that need to be run before the actual command.
// These commands will setup the connection.
PreRuns []*exec.Cmd
// File contains the content of the configuration file based on the connection
Files map[string]bytes.Buffer
}
type Event ¶ added in v1.0.273
type Event struct {
ID uuid.UUID `gorm:"default:generate_ulid()"`
EventID uuid.UUID `json:"event_id"`
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
Properties types.JSONStringMap `json:"properties"`
Delay *time.Duration `json:"delay,omitempty"`
Error *string `json:"error,omitempty"`
Attempts int `json:"attempts"`
LastAttempt *time.Time `json:"last_attempt"`
Priority int `json:"priority"`
}
type EventQueueSummary ¶ added in v1.0.273
type EventQueueSummary struct {
EventID uuid.UUID `json:"event_id"`
Name string `json:"name"`
Pending int64 `json:"pending"`
Failed int64 `json:"failed"`
AvgAttempts int64 `json:"average_attempts"`
FirstFailure *time.Time `json:"first_failure,omitempty"`
LastFailure *time.Time `json:"last_failure,omitempty"`
MostCommonErr string `json:"most_common_error,omitempty"`
}
func (*EventQueueSummary) TableName ¶ added in v1.0.273
func (t *EventQueueSummary) TableName() string
type Evidence ¶ added in v1.0.24
type Evidence struct {
ID uuid.UUID `json:"id"`
HypothesisID uuid.UUID `json:"hypothesis_id"`
ConfigID *uuid.UUID `json:"config_id"`
ConfigChangeID *uuid.UUID `json:"config_change_id"`
ConfigAnalysisID *uuid.UUID `json:"config_analysis_id"`
ComponentID *uuid.UUID `json:"component_id"`
CheckID *uuid.UUID `json:"check_id"`
Description string `json:"description"`
DefinitionOfDone bool `json:"definition_of_done"`
Done bool `json:"done"`
Factor bool `json:"factor"`
Mitigator bool `json:"mitigator"`
CreatedBy uuid.UUID `json:"created_by"`
Type string `json:"type"`
Script string `json:"script"`
ScriptResult string `json:"script_result"`
Evidence types.JSONMap `json:"evidence"`
Properties types.JSONMap `json:"properties"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type EvidenceCanaryCheck ¶ added in v1.0.24
type EvidenceCanaryCheck struct {
}
type EvidenceComponent ¶ added in v1.0.24
type EvidenceComponent struct {
}
type EvidenceConfig ¶ added in v1.0.24
type EvidenceConfig struct {
ID uuid.UUID `json:"id"`
Lines []string `json:"lines"`
SelectedLines types.JSONStringMap `json:"selected_lines"`
}
type EvidenceConfigAnalysis ¶ added in v1.0.24
type EvidenceConfigChange ¶ added in v1.0.24
type EvidenceLogs ¶ added in v1.0.24
type EvidenceLogs struct {
Lines []LogLine `json:"lines"`
}
type ExtendedDBTable ¶ added in v1.0.428
TODO: Find a better way to handle this
type ExternalGroup ¶ added in v1.0.937
type ExternalGroup struct {
types.NoOpResourceSelectable `json:"-"`
ID uuid.UUID `json:"id"`
ScraperID uuid.UUID `json:"scraper_id" gorm:"not null"`
Tenant string `json:"account_id" gorm:"column:account_id"`
Aliases pq.StringArray `json:"aliases,omitempty" gorm:"type:[]text"`
Name string `json:"name"`
CreatedAt time.Time `json:"created_at" gorm:"not null"`
UpdatedAt *time.Time `json:"updated_at" gorm:"autoUpdateTime:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
GroupType string `json:"group_type"`
}
ExternalGroup represents a group from an external identity provider.
func (ExternalGroup) GetAliases ¶ added in v1.0.1208
func (e ExternalGroup) GetAliases() []string
func (ExternalGroup) GetFieldsMatcher ¶ added in v1.0.946
func (e ExternalGroup) GetFieldsMatcher() fields.Fields
func (ExternalGroup) GetID ¶ added in v1.0.946
func (e ExternalGroup) GetID() string
func (ExternalGroup) GetName ¶ added in v1.0.946
func (e ExternalGroup) GetName() string
func (ExternalGroup) GetType ¶ added in v1.0.946
func (e ExternalGroup) GetType() string
func (ExternalGroup) PK ¶ added in v1.0.937
func (e ExternalGroup) PK() string
func (*ExternalGroup) SetAliases ¶ added in v1.0.1208
func (e *ExternalGroup) SetAliases(aliases []string)
func (ExternalGroup) TableName ¶ added in v1.0.937
func (e ExternalGroup) TableName() string
type ExternalID ¶ added in v1.0.5
func (ExternalID) CacheKey ¶ added in v1.0.5
func (e ExternalID) CacheKey() string
func (ExternalID) IsEmpty ¶ added in v1.0.5
func (e ExternalID) IsEmpty() bool
func (ExternalID) String ¶ added in v1.0.5
func (e ExternalID) String() string
func (ExternalID) WhereClause ¶ added in v1.0.5
func (e ExternalID) WhereClause(db *gorm.DB) *gorm.DB
type ExternalRole ¶ added in v1.0.937
type ExternalRole struct {
ID uuid.UUID `json:"id"`
Tenant string `json:"account_id" gorm:"column:account_id"`
// ApplicationID links the role to a specific application (e.g. Azure AD App Registration).
ApplicationID *uuid.UUID `json:"application_id" gorm:"default:null"`
ScraperID *uuid.UUID `json:"scraper_id" gorm:"default:null"`
Aliases pq.StringArray `json:"aliases" gorm:"type:[]text"`
RoleType string `json:"role_type"`
Name string `json:"name"`
Description string `json:"description"`
CreatedAt time.Time `json:"created_at" gorm:"<-:create"`
UpdatedAt *time.Time `json:"updated_at" gorm:"autoUpdateTime:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
ExternalRole represents a role from an external identity provider.
func (ExternalRole) GetAliases ¶ added in v1.0.1208
func (e ExternalRole) GetAliases() []string
func (ExternalRole) PK ¶ added in v1.0.937
func (e ExternalRole) PK() string
func (*ExternalRole) SetAliases ¶ added in v1.0.1208
func (e *ExternalRole) SetAliases(aliases []string)
func (ExternalRole) TableName ¶ added in v1.0.937
func (e ExternalRole) TableName() string
type ExternalUser ¶ added in v1.0.937
type ExternalUser struct {
types.NoOpResourceSelectable `json:"-"`
// ID is the stable unique identifier (e.g. Azure object UUID, deterministic hash of aliases).
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
Aliases pq.StringArray `json:"aliases,omitempty" gorm:"type:[]text"`
Name string `json:"name"`
// Tenant identifies the parent account (Azure Tenant ID, AWS Account ID, GCP Project, K8s cluster name).
Tenant string `json:"account_id,omitempty" gorm:"column:account_id" `
UserType string `json:"user_type"`
Email *string `json:"email,omitempty" gorm:"default:null"`
ScraperID uuid.UUID `json:"scraper_id" gorm:"not null"`
CreatedAt time.Time `json:"created_at" gorm:"not null"`
UpdatedAt *time.Time `json:"updated_at" gorm:"autoUpdateTime:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
CreatedBy *string `json:"created_by,omitempty" gorm:"default:null"`
}
ExternalUser represents a user from an external identity provider.
func (ExternalUser) GetAliases ¶ added in v1.0.1208
func (e ExternalUser) GetAliases() []string
func (ExternalUser) GetFieldsMatcher ¶ added in v1.0.946
func (e ExternalUser) GetFieldsMatcher() fields.Fields
func (ExternalUser) GetID ¶ added in v1.0.946
func (e ExternalUser) GetID() string
func (ExternalUser) GetName ¶ added in v1.0.946
func (e ExternalUser) GetName() string
func (ExternalUser) GetType ¶ added in v1.0.946
func (e ExternalUser) GetType() string
func (ExternalUser) PK ¶ added in v1.0.937
func (e ExternalUser) PK() string
func (*ExternalUser) SetAliases ¶ added in v1.0.1208
func (e *ExternalUser) SetAliases(aliases []string)
func (ExternalUser) TableName ¶ added in v1.0.937
func (e ExternalUser) TableName() string
type ExternalUserAlias ¶ added in v1.0.1359
type ExternalUserAlias struct {
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
ExternalUserID uuid.UUID `json:"external_user_id" gorm:"not null"`
Alias string `json:"alias" gorm:"not null"`
Source string `json:"source" gorm:"not null;default:scrape"`
CreatedAt time.Time `json:"created_at" gorm:"not null"`
CreatedBy *uuid.UUID `json:"created_by,omitempty"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
DeletedBy *uuid.UUID `json:"deleted_by,omitempty"`
}
ExternalUserAlias is the normalized lookup index for an alias in ExternalUser.Aliases. The aliases array remains the source of truth; this model carries uniqueness, provenance, and audit metadata for each key.
func (ExternalUserAlias) PK ¶ added in v1.0.1359
func (e ExternalUserAlias) PK() string
func (ExternalUserAlias) TableName ¶ added in v1.0.1359
func (e ExternalUserAlias) TableName() string
type ExternalUserGroup ¶ added in v1.0.937
type ExternalUserGroup struct {
ExternalUserID uuid.UUID `json:"external_user_id" gorm:"primaryKey"`
ExternalGroupID uuid.UUID `json:"external_group_id" gorm:"primaryKey"`
ScraperID uuid.UUID `json:"scraper_id" gorm:"primaryKey"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
DeletedBy *uuid.UUID `json:"deleted_by"`
CreatedAt time.Time `json:"created_at" gorm:"<-:create"`
CreatedBy *uuid.UUID `json:"created_by"`
}
ExternalUserGroup links an external user to an external group (many-to-many).
func (ExternalUserGroup) TableName ¶ added in v1.0.937
func (e ExternalUserGroup) TableName() string
type GeneratedViewTable ¶ added in v1.0.983
type GeneratedViewTable struct {
ViewTableName string `json:"viewTableName"`
PrimaryKey []string `json:"primaryKey"` // Columns to use as the primary key
Row map[string]any `json:"data"`
ColumnDef map[string]ColumnType `json:"columnDef"`
}
GeneratedViewTable represents a record in a dynamically generated view_* table
func (GeneratedViewTable) AsMap ¶ added in v1.0.983
func (v GeneratedViewTable) AsMap(removeFields ...string) map[string]any
func (GeneratedViewTable) GetUnpushed ¶ added in v1.0.983
func (t GeneratedViewTable) GetUnpushed(db *gorm.DB) ([]DBTable, error)
GetUnpushed returns all unpushed records from all view_* tables
func (GeneratedViewTable) PK ¶ added in v1.0.983
func (v GeneratedViewTable) PK() string
func (GeneratedViewTable) TableName ¶ added in v1.0.983
func (v GeneratedViewTable) TableName() string
func (GeneratedViewTable) UpdateIsPushed ¶ added in v1.0.983
func (t GeneratedViewTable) UpdateIsPushed(db *gorm.DB, items []DBTable) error
type Health ¶ added in v1.0.423
type Health string
func WorseHealth ¶ added in v1.0.613
type Hypothesis ¶ added in v1.0.24
type Hypothesis struct {
ID uuid.UUID `json:"id,omitempty" gorm:"default:generate_ulid()"`
IncidentID uuid.UUID `json:"incident_id,omitempty"`
Type string `json:"type,omitempty"`
Title string `json:"title,omitempty"`
Status string `json:"status,omitempty"`
ParentID *uuid.UUID `json:"parent_id,omitempty"`
TeamID *uuid.UUID `json:"team_id,omitempty"`
Owner *uuid.UUID `json:"owner,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
CreatedBy uuid.UUID `json:"created_by,omitempty"`
}
func (Hypothesis) AsMap ¶ added in v1.0.129
func (h Hypothesis) AsMap(removeFields ...string) map[string]any
func (Hypothesis) PK ¶ added in v1.0.561
func (h Hypothesis) PK() string
func (Hypothesis) TableName ¶ added in v1.0.24
func (Hypothesis) TableName() string
type Incident ¶ added in v1.0.24
type Incident struct {
ID uuid.UUID `json:"id,omitempty" gorm:"default:generate_ulid()"`
IncidentID string `json:"incident_id,omitempty" gorm:"default:format_incident_id(NEXTVAL('incident_id_sequence'))"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Type IncidentType `json:"type,omitempty"`
Status IncidentStatus `json:"status,omitempty"`
Severity Severity `json:"severity,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
Acknowledged *time.Time `json:"acknowledged,omitempty"`
Resolved *time.Time `json:"resolved,omitempty"`
Closed *time.Time `json:"closed,omitempty"`
CreatedBy uuid.UUID `json:"created_by,omitempty"`
IncidentRuleID *uuid.UUID `json:"incident_rule_id,omitempty"`
CommanderID *uuid.UUID `json:"commander_id,omitempty"`
CommunicatorID *uuid.UUID `json:"communicator_id,omitempty"`
}
type IncidentStatus ¶ added in v1.0.24
type IncidentStatus string
var ( IncidentStatusOpen IncidentStatus = "open" IncidentStatusClosed IncidentStatus = "closed" IncidentStatusMitigated IncidentStatus = "mitigated" IncidentStatusResolved IncidentStatus = "resolved" IncidentStatusCancelled IncidentStatus = "cancelled" )
type IncidentType ¶ added in v1.0.24
type IncidentType string
var ( IncidentTypeAvailability IncidentType = "availability" IncidentTypeCost IncidentType = "cost" IncidentTypePerformance IncidentType = "performance" IncidentTypeSecurity IncidentType = "security" IncidentTypeTechnicalDebt IncidentType = "technical_debt" IncidentTypeCompliance IncidentType = "compliance" IncidentTypeIntegration IncidentType = "integration" )
type Integration ¶ added in v1.0.238
type Integration struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Integration IntegrationType `json:"integration"`
Source string `json:"source"`
AgentID *uuid.UUID `json:"agent_id,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
CreatedBy *uuid.UUID `json:"created_by,omitempty"`
JobName string `json:"job_name"`
JobSuccess int `json:"job_success_count"`
JobError int `json:"job_error_count"`
JobDetails string `json:"job_details"`
JobHostname string `json:"job_hostname"`
JobDuration int `json:"job_duration_millis"`
JobResource string `json:"job_resource_type"`
JobStatus string `json:"job_status"`
JobTimeStart time.Time `json:"job_time_start"`
JobTimeEnd time.Time `json:"job_time_end"`
JobCreatedAt time.Time `json:"job_created_at"`
}
func (Integration) PK ¶ added in v1.0.561
func (i Integration) PK() string
func (*Integration) TableName ¶ added in v1.0.238
func (t *Integration) TableName() string
type IntegrationType ¶ added in v1.0.238
type IntegrationType string
const ( IntegrationTypeScraper IntegrationType = "scrapers" IntegrationTypeLoggingBackends IntegrationType = "logging_backends" IntegrationTypeTopology IntegrationType = "topology" )
func (IntegrationType) Pretty ¶ added in v1.0.1168
func (i IntegrationType) Pretty() api.Text
type Invite ¶ added in v1.0.1299
type Invite struct {
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
Email string `json:"email"`
Role string `json:"role"`
InvitedAt time.Time `json:"invited_at" gorm:"default:now()"`
InvitedBy *uuid.UUID `json:"invited_by,omitempty" gorm:"default:null"`
AcceptedAt *time.Time `json:"accepted_at,omitempty" gorm:"default:null"`
}
type JobHistory ¶
type JobHistory struct {
ID uuid.UUID `gorm:"default:generate_ulid()"`
AgentID uuid.UUID `json:"agent_id,omitempty"`
Name string
SuccessCount int
ErrorCount int
Hostname string
DurationMillis int64
ResourceType string
ResourceID string
Details types.JSONMap
Status string
TimeStart time.Time
TimeEnd *time.Time
Errors []string `gorm:"-"`
Logger logger.Logger `gorm:"-"`
}
func NewJobHistory ¶ added in v1.0.4
func NewJobHistory(log logger.Logger, name, resourceType, resourceID string) *JobHistory
func (*JobHistory) AddDetails ¶ added in v1.0.525
func (h *JobHistory) AddDetails(key string, val any)
func (*JobHistory) AddError ¶
func (h *JobHistory) AddError(err any) *JobHistory
func (*JobHistory) AddErrorWithSkipReportLevel ¶ added in v1.0.310
func (h *JobHistory) AddErrorWithSkipReportLevel(err string, level int) *JobHistory
func (*JobHistory) AddErrorf ¶ added in v1.0.270
func (h *JobHistory) AddErrorf(msg string, args ...interface{}) *JobHistory
func (JobHistory) AsError ¶ added in v1.0.307
func (j JobHistory) AsError() error
func (*JobHistory) End ¶
func (h *JobHistory) End() *JobHistory
func (JobHistory) GetAgentID ¶ added in v1.0.1064
func (j JobHistory) GetAgentID() string
func (JobHistory) GetUnpushed ¶ added in v1.0.476
func (j JobHistory) GetUnpushed(db *gorm.DB) ([]DBTable, error)
func (*JobHistory) IncrSuccess ¶
func (h *JobHistory) IncrSuccess() *JobHistory
func (JobHistory) PK ¶ added in v1.0.476
func (j JobHistory) PK() string
func (*JobHistory) Start ¶
func (h *JobHistory) Start() *JobHistory
func (*JobHistory) String ¶ added in v1.0.254
func (h *JobHistory) String() string
func (JobHistory) TableName ¶ added in v1.0.250
func (j JobHistory) TableName() string
type LabelableModel ¶ added in v1.0.826
type Link ¶ added in v1.0.15
type Link struct {
// e.g. documentation, support, playbook
Type string `json:"type,omitempty"`
URL string `json:"url,omitempty"`
Text `json:",inline"`
}
+kubebuilder:object:generate=true
func (*Link) DeepCopy ¶ added in v1.0.317
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Link.
func (*Link) DeepCopyInto ¶ added in v1.0.317
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type LocalTime ¶ added in v1.0.24
func (LocalTime) MarshalJSON ¶ added in v1.0.24
func (*LocalTime) UnmarshalJSON ¶ added in v1.0.24
type LogLine ¶ added in v1.0.24
type LogLine struct {
Timestamp time.Time `json:"timestamp"`
Message string `json:"message"`
Labels types.JSONStringMap `json:"labels"`
}
type LogNameAccessor ¶ added in v1.0.564
type LogNameAccessor interface {
LoggerName() string
}
type LoggingBackend ¶ added in v1.0.40
type LoggingBackend struct {
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
Name string `json:"name"`
Labels types.JSONStringMap `json:"labels" gorm:"type:jsonstringmap"`
Spec string `json:"spec,omitempty"`
Source string `json:"source,omitempty"`
AgentID *uuid.UUID `json:"agent_id,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
func (LoggingBackend) PK ¶ added in v1.0.561
func (l LoggingBackend) PK() string
func (LoggingBackend) TableName ¶ added in v1.0.561
func (l LoggingBackend) TableName() string
type NamespaceScopeAccessor ¶ added in v1.0.564
type NamespaceScopeAccessor interface {
GetNamespace() string
}
type Notification ¶ added in v1.0.129
type Notification struct {
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
Name string `json:"name"`
Namespace string `json:"namespace,omitempty"`
Events pq.StringArray `json:"events" gorm:"type:[]text"`
Title string `json:"title,omitempty"`
Template string `json:"template,omitempty"`
Filter string `json:"filter,omitempty"`
Properties types.JSONStringMap `json:"properties,omitempty"`
Source string `json:"source"`
RepeatInterval string `json:"repeat_interval,omitempty"`
GroupBy pq.StringArray `json:"group_by" gorm:"type:[]text"`
GroupByInterval time.Duration `json:"group_by_interval,omitempty"`
WatchdogSchedule *string `json:"watchdog_schedule,omitempty"`
CreatedBy *uuid.UUID `json:"created_by,omitempty"`
UpdatedAt time.Time `json:"updated_at" time_format:"postgres_timestamp" gorm:"<-:false"`
CreatedAt time.Time `json:"created_at" time_format:"postgres_timestamp" gorm:"<-:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
// List of inhibition config
Inhibitions types.JSON `json:"inhibitions,omitempty" gorm:"default:NULL"`
// Receipients
PlaybookID *uuid.UUID `json:"playbook_id,omitempty"`
PersonID *uuid.UUID `json:"person_id,omitempty"`
TeamID *uuid.UUID `json:"team_id,omitempty"`
CustomServices types.JSON `json:"custom_services,omitempty" gorm:"column:custom_services"`
// Fallback Receipients
FallbackPlaybookID *uuid.UUID `json:"fallback_playbook_id,omitempty"`
FallbackPersonID *uuid.UUID `json:"fallback_person_id,omitempty"`
FallbackTeamID *uuid.UUID `json:"fallback_team_id,omitempty"`
FallbackCustomServices types.JSON `json:"fallback_custom_services,omitempty"`
FallbackDelay *time.Duration `json:"fallback_delay,omitempty"`
// Duration to wait before re-evaluating health of the resource.
WaitFor *time.Duration `json:"wait_for,omitempty"`
// Duration to wait after triggering incremental scrape for kubernetes config.
// Works together with waitFor duration.
WaitForEvalPeriod *time.Duration `json:"wait_for_eval_period,omitempty"`
// Error stores errors in notification filters (if any).
Error *string `json:"error,omitempty"`
ErrorAt *time.Time `json:"error_at,omitempty"`
}
Notification represents the notifications table
func (Notification) AsMap ¶ added in v1.0.175
func (n Notification) AsMap(removeFields ...string) map[string]any
func (Notification) GetNamespace ¶ added in v1.0.894
func (n Notification) GetNamespace() string
func (Notification) HasFallbackSet ¶ added in v1.0.867
func (n Notification) HasFallbackSet() bool
func (*Notification) HasRecipients ¶ added in v1.0.129
func (n *Notification) HasRecipients() bool
func (Notification) PK ¶ added in v1.0.561
func (n Notification) PK() string
func (Notification) TableName ¶ added in v1.0.561
func (n Notification) TableName() string
type NotificationGroup ¶ added in v1.0.910
type NotificationGroup struct {
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
NotificationID uuid.UUID `json:"notification_id"`
Hash string `json:"hash"`
CreatedAt time.Time `json:"created_at" gorm:"<-:false"`
}
func (NotificationGroup) TableName ¶ added in v1.0.910
func (t NotificationGroup) TableName() string
type NotificationGroupResource ¶ added in v1.0.910
type NotificationGroupResource struct {
GroupID uuid.UUID `json:"group_id"`
ConfigID *uuid.UUID `json:"config_id,omitempty"`
CheckID *uuid.UUID `json:"check_id,omitempty"`
ComponentID *uuid.UUID `json:"component_id,omitempty"`
CreatedAt time.Time `json:"created_at" gorm:"<-:false"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
ResolvedAt *time.Time `json:"resolved_at,omitempty"`
}
func (NotificationGroupResource) TableName ¶ added in v1.0.910
func (t NotificationGroupResource) TableName() string
type NotificationSendHistory ¶ added in v1.0.181
type NotificationSendHistory struct {
ID uuid.UUID `json:"id,omitempty" gorm:"default:generate_ulid()"`
NotificationID uuid.UUID `json:"notification_id"`
// Rendered body for raw/custom templates and existing clients.
// For clicky-based templates, use BodyPayload as the source of truth.
Body *string `json:"body,omitempty"`
// BodyPayload stores the clicky Schema + Data (source of truth for clicky templates).
BodyPayload types.JSON `json:"body_payload,omitempty" gorm:"column:body_payload"`
Error *string `json:"error,omitempty"`
DurationMillis int64 `json:"duration_millis,omitempty"`
CreatedAt time.Time `json:"created_at" time_format:"postgres_timestamp"`
Status string `json:"status,omitempty"`
// payload holds in original event properties for delayed/pending notifications
Payload types.JSONStringMap `json:"payload,omitempty"`
NotBefore *time.Time `json:"notBefore,omitempty"`
// number of retries of pending notifications
Retries int `json:"retries,omitempty" gorm:"default:null"`
// Notifications that were silenced or blocked by repeat intervals
// use this counter.
Count int `json:"count" gorm:"default:1"`
// Notifications that were silenced or blocked by repeat intervals
// use this as the first observed timestamp.
FirstObserved time.Time `json:"first_observed" gorm:"default:now();<-:create"`
// Name of the original event that caused this notification
SourceEvent string `json:"source_event"`
// ID of the resource this notification is for
ResourceID uuid.UUID `json:"resource_id"`
// Health of the resource at the time of event
ResourceHealth Health `json:"resource_health"`
// Status of the resource at the time of event
ResourceStatus string `json:"resource_status"`
// Health description of the resource at the time of event
ResourceHealthDescription string `json:"resource_health_description,omitempty"`
// ID of the team this notification was dispatched to.
TeamID *uuid.UUID `json:"team_id,omitempty"`
// ID of the person this notification was dispatched to.
PersonID *uuid.UUID `json:"person_id,omitempty"`
// ID of the connection this notification was dispatched to.
ConnectionID *uuid.UUID `json:"connection_id,omitempty"`
// The run created by this notification
PlaybookRunID *uuid.UUID `json:"playbook_run_id,omitempty"`
// The notification silence that silenced this notification.
SilencedBy *uuid.UUID `json:"silenced_by,omitempty"`
// ID of the group this notification was sent for
GroupID *uuid.UUID `json:"group_id,omitempty"`
// ID of the original send history this notification history is a fallback of.
ParentID *uuid.UUID `json:"parent_id,omitempty"`
// contains filtered or unexported fields
}
func NewNotificationSendHistory ¶ added in v1.0.181
func NewNotificationSendHistory(notificationID uuid.UUID) *NotificationSendHistory
func (NotificationSendHistory) AsMap ¶ added in v1.0.181
func (n NotificationSendHistory) AsMap(removeFields ...string) map[string]any
func (*NotificationSendHistory) End ¶ added in v1.0.181
func (t *NotificationSendHistory) End() *NotificationSendHistory
func (*NotificationSendHistory) PendingPlaybookRun ¶ added in v1.0.773
func (t *NotificationSendHistory) PendingPlaybookRun() *NotificationSendHistory
func (*NotificationSendHistory) Sent ¶ added in v1.0.268
func (t *NotificationSendHistory) Sent() *NotificationSendHistory
func (*NotificationSendHistory) TableName ¶ added in v1.0.181
func (t *NotificationSendHistory) TableName() string
func (*NotificationSendHistory) WithStartTime ¶ added in v1.0.752
func (t *NotificationSendHistory) WithStartTime(s time.Time) *NotificationSendHistory
type NotificationSilence ¶ added in v1.0.632
type NotificationSilence struct {
NotificationSilenceResource `json:",inline" yaml:",inline"`
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
Namespace string `json:"namespace,omitempty" gorm:"default:NULL"`
Name string `json:"name,omitempty"`
Filter types.CelExpression `json:"filter,omitempty" gorm:"default:NULL"`
From *time.Time `json:"from,omitempty"`
Until *time.Time `json:"until,omitempty"`
Source string `json:"source"`
Recursive bool `json:"recursive"`
Description *string `json:"description,omitempty" gorm:"default:NULL"`
CreatedBy *uuid.UUID `json:"created_by,omitempty"`
CreatedAt time.Time `json:"created_at" time_format:"postgres_timestamp" gorm:"<-:false"`
UpdatedAt time.Time `json:"updated_at" time_format:"postgres_timestamp" gorm:"<-:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
Selectors types.JSON `json:"selectors,omitempty" gorm:"default:NULL"`
// Error contains cel expression error in the filter
Error *string `json:"error,omitempty"`
}
func (NotificationSilence) AsMap ¶ added in v1.0.632
func (n NotificationSilence) AsMap(removeFields ...string) map[string]any
func (NotificationSilence) GetNamespace ¶ added in v1.0.894
func (t NotificationSilence) GetNamespace() string
func (*NotificationSilence) TableName ¶ added in v1.0.632
func (t *NotificationSilence) TableName() string
type NotificationSilenceResource ¶ added in v1.0.632
type NotificationSilenceResource struct {
ConfigID *string `json:"config_id,omitempty"`
CanaryID *string `json:"canary_id,omitempty"`
ComponentID *string `json:"component_id,omitempty"`
CheckID *string `json:"check_id,omitempty"`
}
func (NotificationSilenceResource) Empty ¶ added in v1.0.635
func (t NotificationSilenceResource) Empty() bool
type NotificationSummary ¶ added in v1.0.917
type NotificationSummary struct {
ID string
Name string
Namespace string
Sent int
Failed int
Pending int
UpdatedAt time.Time
Error string
LastFailedAt time.Time
}
NotificationSummary represents the notifications_summary view
func (NotificationSummary) AsMap ¶ added in v1.0.918
func (t NotificationSummary) AsMap() map[string]any
func (NotificationSummary) TableName ¶ added in v1.0.919
func (t NotificationSummary) TableName() string
type Permission ¶ added in v1.0.674
type Permission struct {
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
Name string `json:"name"`
Namespace string `json:"namespace,omitempty" gorm:"default:NULL"`
Deny bool `json:"deny"`
Description string `json:"description"`
Source string `json:"source"`
Until *time.Time `json:"until"`
Error *string `json:"error,omitempty" gorm:"default:NULL"`
// Action supports matchItem
Action string `json:"action"`
Subject string `json:"subject"`
SubjectType PermissionSubjectType `json:"subject_type,omitempty"`
// Deprecated: Use Subject
PersonID *uuid.UUID `json:"person_id,omitempty"`
// Deprecated: Use Subject
NotificationID *uuid.UUID `json:"notification_id,omitempty"`
// Deprecated: Use Subject
TeamID *uuid.UUID `json:"team_id,omitempty"`
CanaryID *uuid.UUID `json:"canary_id,omitempty"`
ComponentID *uuid.UUID `json:"component_id,omitempty"`
ConfigID *uuid.UUID `json:"config_id,omitempty"`
ConnectionID *uuid.UUID `json:"connection_id,omitempty"`
PlaybookID *uuid.UUID `json:"playbook_id,omitempty"`
Object string `json:"object,omitempty" gorm:"default:NULL"`
ObjectSelector types.JSON `json:"object_selector,omitempty" gorm:"default:NULL"`
CreatedBy *uuid.UUID `json:"created_by,omitempty" gorm:"default:NULL"`
CreatedAt time.Time `json:"created_at,omitempty" time_format:"postgres_timestamp" gorm:"<-:false"`
UpdatedAt time.Time `json:"updated_at,omitempty" time_format:"postgres_timestamp" gorm:"<-:false"`
UpdatedBy *uuid.UUID `json:"updated_by"`
DeletedAt *time.Time `json:"deleted_at"`
}
func (*Permission) Condition ¶ added in v1.0.674
func (t *Permission) Condition() string
func (*Permission) Effect ¶ added in v1.0.674
func (t *Permission) Effect() string
func (Permission) GetNamespace ¶ added in v1.0.894
func (p Permission) GetNamespace() string
func (*Permission) GetObject ¶ added in v1.0.793
func (t *Permission) GetObject() string
func (Permission) PK ¶ added in v1.0.973
func (p Permission) PK() string
func (*Permission) Principal ¶ added in v1.0.674
func (t *Permission) Principal() string
func (Permission) TableName ¶ added in v1.0.973
func (p Permission) TableName() string
type PermissionGroup ¶ added in v1.0.793
type PermissionGroup struct {
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
Name string `json:"name"`
Namespace string `json:"namespace,omitempty" gorm:"default:NULL"`
Source string `json:"source"`
Selectors types.JSON `json:"selectors"`
CreatedBy *uuid.UUID `json:"created_by,omitempty" gorm:"default:NULL"`
CreatedAt time.Time `json:"created_at,omitempty" time_format:"postgres_timestamp" gorm:"<-:false"`
UpdatedAt time.Time `json:"updated_at,omitempty" time_format:"postgres_timestamp" gorm:"<-:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
func (PermissionGroup) GetNamespace ¶ added in v1.0.894
func (p PermissionGroup) GetNamespace() string
type PermissionSubjectType ¶ added in v1.0.793
type PermissionSubjectType string
const ( PermissionSubjectTypeCanary PermissionSubjectType = "canary" PermissionSubjectTypeGroup PermissionSubjectType = "group" PermissionSubjectTypeNotification PermissionSubjectType = "notification" PermissionSubjectTypePerson PermissionSubjectType = "person" PermissionSubjectTypePlaybook PermissionSubjectType = "playbook" PermissionSubjectTypePlugin PermissionSubjectType = "plugin" PermissionSubjectTypeScraper PermissionSubjectType = "scraper" PermissionSubjectTypeTeam PermissionSubjectType = "team" PermissionSubjectTypeTopology PermissionSubjectType = "topology" )
func (PermissionSubjectType) Pretty ¶ added in v1.0.1168
func (p PermissionSubjectType) Pretty() api.Text
type Person ¶ added in v1.0.24
type Person struct {
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
Name string `json:"name"`
Email string `json:"email,omitempty" gorm:"default:null"`
Type string `json:"type,omitempty" gorm:"default:null"`
Avatar string `json:"avatar,omitempty" gorm:"default:null"`
ExternalID string `json:"external_id,omitempty" gorm:"default:null"`
Properties PersonProperties `json:"properties,omitempty" gorm:"default:null"`
}
type PersonProperties ¶ added in v1.0.24
type PersonProperties struct {
Role string `json:"role,omitempty"`
}
func (*PersonProperties) Scan ¶ added in v1.0.24
func (p *PersonProperties) Scan(val any) error
type Playbook ¶ added in v1.0.155
type Playbook struct {
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
Namespace string `json:"namespace"`
Name string `json:"name"`
Title string `json:"title"`
Icon string `json:"icon,omitempty"`
Description string `json:"description,omitempty"`
Spec types.JSON `json:"spec"`
Source string `json:"source"`
Category string `json:"category"`
CreatedBy *uuid.UUID `json:"created_by,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty" time_format:"postgres_timestamp" gorm:"<-:false"`
UpdatedAt time.Time `json:"updated_at,omitempty" time_format:"postgres_timestamp" gorm:"<-:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty" time_format:"postgres_timestamp"`
}
func (*Playbook) GetFieldsMatcher ¶ added in v1.0.793
func (*Playbook) GetLabelsMatcher ¶ added in v1.0.793
func (*Playbook) GetNamespace ¶ added in v1.0.793
func (*Playbook) GetTagsMatcher ¶ added in v1.0.798
func (*Playbook) LoggerName ¶ added in v1.0.564
func (*Playbook) NamespacedName ¶ added in v1.0.772
func (Playbook) SelectableFields ¶ added in v1.0.798
type PlaybookActionAgentData ¶ added in v1.0.295
type PlaybookActionAgentData struct {
ActionID uuid.UUID `json:"action_id"`
RunID uuid.UUID `json:"run_id"`
PlaybookID uuid.UUID `json:"playbook_id"`
Spec types.JSON `json:"spec"`
Env types.JSON `json:"env,omitempty"`
}
func (*PlaybookActionAgentData) Context ¶ added in v1.0.564
func (p *PlaybookActionAgentData) Context() map[string]any
func (*PlaybookActionAgentData) TableName ¶ added in v1.0.295
func (t *PlaybookActionAgentData) TableName() string
type PlaybookActionStatus ¶ added in v1.0.281
type PlaybookActionStatus string
PlaybookRunStatus are statuses for a playbook run and its actions.
const ( // Waiting for child playbook runs to complete PlaybookActionStatusWaitingChildren PlaybookActionStatus = "waiting_children" PlaybookActionStatusCompleted PlaybookActionStatus = "completed" PlaybookActionStatusFailed PlaybookActionStatus = "failed" PlaybookActionStatusRunning PlaybookActionStatus = "running" PlaybookActionStatusScheduled PlaybookActionStatus = "scheduled" PlaybookActionStatusWaiting PlaybookActionStatus = "waiting" // Waiting for agents PlaybookActionStatusSkipped PlaybookActionStatus = "skipped" PlaybookActionStatusSleeping PlaybookActionStatus = "sleeping" )
func (PlaybookActionStatus) Pretty ¶ added in v1.0.1168
func (p PlaybookActionStatus) Pretty() api.Text
type PlaybookApproval ¶ added in v1.0.158
type PlaybookApproval struct {
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
RunID uuid.UUID `json:"run_id"`
PersonID *uuid.UUID `json:"person_id,omitempty"`
TeamID *uuid.UUID `json:"team_id,omitempty"`
CreatedAt time.Time `json:"created_at" gorm:"<-:false"`
}
func (PlaybookApproval) AsMap ¶ added in v1.0.175
func (p PlaybookApproval) AsMap(removeFields ...string) map[string]any
func (PlaybookApproval) PK ¶ added in v1.0.561
func (p PlaybookApproval) PK() string
func (PlaybookApproval) TableName ¶ added in v1.0.561
func (p PlaybookApproval) TableName() string
type PlaybookRun ¶ added in v1.0.155
type PlaybookRun struct {
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
PlaybookID uuid.UUID `json:"playbook_id"`
Status PlaybookRunStatus `json:"status,omitempty"`
Spec types.JSON `json:"spec"`
CreatedAt time.Time `json:"created_at,omitempty" time_format:"postgres_timestamp" gorm:"<-:false"`
StartTime *time.Time `json:"start_time,omitempty" time_format:"postgres_timestamp"`
ScheduledTime time.Time `json:"scheduled_time,omitempty" time_format:"postgres_timestamp" gorm:"default:NOW(), NOT NULL"`
EndTime *time.Time `json:"end_time,omitempty" time_format:"postgres_timestamp"`
Timeout time.Duration `json:"timeout,omitempty"`
CreatedBy *uuid.UUID `json:"created_by,omitempty"`
ComponentID *uuid.UUID `json:"component_id,omitempty"`
CheckID *uuid.UUID `json:"check_id,omitempty"`
ConfigID *uuid.UUID `json:"config_id,omitempty"`
Error *string `json:"error,omitempty"`
Parameters types.JSONStringMap `json:"parameters,omitempty" gorm:"default:null"`
Request types.JSONMap `json:"request,omitempty" gorm:"default:null"`
AgentID *uuid.UUID `json:"agent_id,omitempty"`
// Parent Run's id
ParentID *uuid.UUID `json:"parent_id,omitempty"`
// Parent notification send's id
NotificationSendID *uuid.UUID `json:"notification_send_id,omitempty"`
}
func (PlaybookRun) AsMap ¶ added in v1.0.175
func (p PlaybookRun) AsMap(removeFields ...string) map[string]any
func (PlaybookRun) Context ¶ added in v1.0.564
func (p PlaybookRun) Context() map[string]any
func (PlaybookRun) EndAsTimedOut ¶ added in v1.0.905
func (p PlaybookRun) EndAsTimedOut(db *gorm.DB) error
func (*PlaybookRun) GetABACAttributes ¶ added in v1.0.816
func (run *PlaybookRun) GetABACAttributes(db *gorm.DB) (*ABACAttribute, error)
func (PlaybookRun) GetAction ¶ added in v1.0.564
func (p PlaybookRun) GetAction(db *gorm.DB, name string) (action *PlaybookRunAction, err error)
func (PlaybookRun) GetActions ¶ added in v1.0.564
func (p PlaybookRun) GetActions(db *gorm.DB) (actions []PlaybookRunAction, err error)
func (PlaybookRun) GetAgentAction ¶ added in v1.0.567
func (p PlaybookRun) GetAgentAction(db *gorm.DB, name string) (*PlaybookRunAction, error)
func (PlaybookRun) GetAgentActions ¶ added in v1.0.567
func (p PlaybookRun) GetAgentActions(db *gorm.DB) (actions []PlaybookRunAction, err error)
func (PlaybookRun) GetPlaybook ¶ added in v1.0.564
func (p PlaybookRun) GetPlaybook(db *gorm.DB) (*Playbook, error)
func (PlaybookRun) Load ¶ added in v1.0.564
func (p PlaybookRun) Load(db *gorm.DB) (*PlaybookRun, error)
func (PlaybookRun) PK ¶ added in v1.0.561
func (p PlaybookRun) PK() string
func (PlaybookRun) Pretty ¶ added in v1.0.1168
func (p PlaybookRun) Pretty() api.Text
func (PlaybookRun) PrettyRow ¶ added in v1.0.1168
func (p PlaybookRun) PrettyRow(opts interface{}) map[string]api.Text
func (PlaybookRun) ResumeChildrenWaitingAction ¶ added in v1.0.906
func (p PlaybookRun) ResumeChildrenWaitingAction(db *gorm.DB) error
ResumeChildrenWaitingAction resumes the action that's awaiting children if all its children have terminated.
func (PlaybookRun) RetryAction ¶ added in v1.0.852
func (p PlaybookRun) RetryAction(db *gorm.DB, action string, retryCount int) (*PlaybookRunAction, error)
func (PlaybookRun) StartAction ¶ added in v1.0.564
func (p PlaybookRun) StartAction(db *gorm.DB, action string) (*PlaybookRunAction, error)
func (PlaybookRun) TableName ¶ added in v1.0.561
func (p PlaybookRun) TableName() string
type PlaybookRunAction ¶ added in v1.0.155
type PlaybookRunAction struct {
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
Name string `json:"name" gorm:"not null"`
PlaybookRunID uuid.UUID `json:"playbook_run_id"`
Status PlaybookActionStatus `json:"status,omitempty"`
ScheduledTime time.Time `json:"scheduled_time,omitempty" time_format:"postgres_timestamp" gorm:"default:NOW(), NOT NULL"`
StartTime time.Time `json:"start_time,omitempty" time_format:"postgres_timestamp" gorm:"default:NOW(), NOT NULL"`
EndTime *time.Time `json:"end_time,omitempty" time_format:"postgres_timestamp"`
Result types.JSONMap `json:"result,omitempty" gorm:"default:null"`
Error *string `json:"error,omitempty" gorm:"default:null"`
IsPushed bool `json:"is_pushed"`
AgentID *uuid.UUID `json:"agent_id,omitempty"`
// RetryCount represents the Nth retry of this action
RetryCount int `json:"attempt,omitempty" gorm:"default:NULL"`
}
func (PlaybookRunAction) AsMap ¶ added in v1.0.175
func (p PlaybookRunAction) AsMap(removeFields ...string) map[string]any
func (PlaybookRunAction) Complete ¶ added in v1.0.564
func (p PlaybookRunAction) Complete(db *gorm.DB, result any) error
func (PlaybookRunAction) Context ¶ added in v1.0.564
func (p PlaybookRunAction) Context() map[string]any
func (PlaybookRunAction) GetPlaybook ¶ added in v1.0.564
func (p PlaybookRunAction) GetPlaybook(db *gorm.DB) (*Playbook, error)
func (PlaybookRunAction) GetRun ¶ added in v1.0.564
func (p PlaybookRunAction) GetRun(db *gorm.DB) (*PlaybookRun, error)
func (PlaybookRunAction) JSON ¶ added in v1.0.567
func (p PlaybookRunAction) JSON() (out map[string]any)
func (PlaybookRunAction) Load ¶ added in v1.0.564
func (p PlaybookRunAction) Load(db *gorm.DB) (*PlaybookRunAction, error)
func (PlaybookRunAction) PK ¶ added in v1.0.561
func (p PlaybookRunAction) PK() string
func (PlaybookRunAction) ScheduleRun ¶ added in v1.0.564
func (p PlaybookRunAction) ScheduleRun(db *gorm.DB) error
func (PlaybookRunAction) Skip ¶ added in v1.0.564
func (p PlaybookRunAction) Skip(db *gorm.DB) error
func (PlaybookRunAction) Start ¶ added in v1.0.564
func (p PlaybookRunAction) Start(db *gorm.DB) error
func (PlaybookRunAction) String ¶ added in v1.0.564
func (p PlaybookRunAction) String() string
func (PlaybookRunAction) TableName ¶ added in v1.0.561
func (p PlaybookRunAction) TableName() string
func (PlaybookRunAction) WaitForChildren ¶ added in v1.0.889
func (p PlaybookRunAction) WaitForChildren(db *gorm.DB) error
type PlaybookRunStatus ¶ added in v1.0.155
type PlaybookRunStatus string
PlaybookRunStatus are statuses for a playbook run and its actions.
const ( PlaybookRunStatusCancelled PlaybookRunStatus = "cancelled" PlaybookRunStatusTimedOut PlaybookRunStatus = "timed_out" PlaybookRunStatusCompleted PlaybookRunStatus = "completed" PlaybookRunStatusFailed PlaybookRunStatus = "failed" PlaybookRunStatusPendingApproval PlaybookRunStatus = "pending_approval" PlaybookRunStatusRunning PlaybookRunStatus = "running" PlaybookRunStatusScheduled PlaybookRunStatus = "scheduled" PlaybookRunStatusSleeping PlaybookRunStatus = "sleeping" PlaybookRunStatusRetrying PlaybookRunStatus = "retrying" PlaybookRunStatusWaiting PlaybookRunStatus = "waiting" // waiting for a consumer )
func (PlaybookRunStatus) Pretty ¶ added in v1.0.1168
func (p PlaybookRunStatus) Pretty() api.Text
type Plugin ¶ added in v1.0.1325
type Plugin struct {
ID uuid.UUID `gorm:"primaryKey;column:id;default:generate_ulid()" json:"id"`
Name string `gorm:"column:name;not null" json:"name"`
Namespace string `gorm:"column:namespace;not null;default:default" json:"namespace"`
Source string `gorm:"column:source" json:"source,omitempty"`
Spec types.JSON `gorm:"column:spec;not null" json:"spec"`
InstalledPath string `gorm:"column:installed_path" json:"installed_path,omitempty"`
PluginVersion string `gorm:"column:plugin_version" json:"plugin_version,omitempty"`
CreatedAt time.Time `gorm:"column:created_at;default:now();<-:create" json:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at;default:now()" json:"updated_at"`
DeletedAt *time.Time `gorm:"column:deleted_at" json:"deleted_at,omitempty"`
}
Plugin is the persisted form of a Mission Control Plugin CRD. It is the source of truth for "which plugins are configured"; the in-memory registry is rehydrated from this table on startup. The full v1.PluginSpec is held verbatim in the spec jsonb column.
type Properties ¶ added in v1.0.15
type Properties []*Property
func (Properties) AsJSON ¶ added in v1.0.15
func (p Properties) AsJSON() []byte
func (Properties) AsMap ¶ added in v1.0.15
func (p Properties) AsMap() map[string]any
func (Properties) Find ¶ added in v1.0.15
func (p Properties) Find(name string) *Property
func (Properties) GormDBDataType ¶ added in v1.0.15
func (Properties) GormDataType ¶ added in v1.0.15
func (Properties) GormDataType() string
GormDataType gorm common data type
func (*Properties) Scan ¶ added in v1.0.15
func (p *Properties) Scan(val any) error
Scan scan value into Jsonb, implements sql.Scanner interface
type Property ¶ added in v1.0.15
type Property struct {
Label string `json:"label,omitempty"`
Name string `json:"name,omitempty"`
Tooltip string `json:"tooltip,omitempty"`
Icon string `json:"icon,omitempty"`
Type string `json:"type,omitempty"`
Color string `json:"color,omitempty"`
Order int `json:"order,omitempty"`
Headline bool `json:"headline,omitempty"`
Hidden bool `json:"hidden,omitempty"`
// Either text or value is required, but not both.
Text string `json:"text,omitempty"`
Value *int64 `json:"value,omitempty"`
// e.g. milliseconds, bytes, millicores, epoch etc.
Unit string `json:"unit,omitempty"`
Max *int64 `json:"max,omitempty"`
Min *int64 `json:"min,omitempty"`
Status string `json:"status,omitempty"`
LastTransition string `json:"lastTransition,omitempty"`
Links []Link `json:"links,omitempty"`
}
Property is a realized v1.Property without the lookup definition +kubebuilder:object:generate=true
func (*Property) DeepCopy ¶ added in v1.0.317
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Property.
func (*Property) DeepCopyInto ¶ added in v1.0.317
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RelatedConfigDirection ¶ added in v1.0.459
type RelatedConfigDirection string
const ( RelatedConfigTypeIncoming RelatedConfigDirection = "incoming" RelatedConfigTypeOutgoing RelatedConfigDirection = "outgoing" )
func (RelatedConfigDirection) Pretty ¶ added in v1.0.1168
func (r RelatedConfigDirection) Pretty() api.Text
type Responder ¶ added in v1.0.67
type Responder struct {
ID uuid.UUID `gorm:"primaryKey" json:"id"`
IncidentID uuid.UUID `json:"incident_id"`
Type string `json:"type"`
Index *int16 `json:"index,omitempty"`
PersonID *uuid.UUID `json:"person_id,omitempty"`
TeamID *uuid.UUID `json:"team_id,omitempty"`
ExternalID *string `json:"external_id,omitempty"`
Properties *string `gorm:"type:jsonb;default:null" json:"properties,omitempty"`
Acknowledged *time.Time `json:"acknowledged,omitempty" time_format:"postgres_timestamp"`
Resolved *time.Time `json:"resolved,omitempty" time_format:"postgres_timestamp"`
Closed *time.Time `json:"closed,omitempty" time_format:"postgres_timestamp"`
CreatedBy uuid.UUID `json:"created_by"`
CreatedAt time.Time `json:"created_at" time_format:"postgres_timestamp" gorm:"default:CURRENT_TIMESTAMP()"`
UpdatedAt time.Time `json:"updated_at" time_format:"postgres_timestamp" gorm:"default:CURRENT_TIMESTAMP()"`
}
type Scope ¶ added in v1.0.1057
type Scope struct {
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
Name string `json:"name"`
Namespace string `json:"namespace,omitempty" gorm:"default:NULL"`
Description string `json:"description,omitempty"`
Source string `json:"source"`
CreatedBy *uuid.UUID `json:"created_by,omitempty"`
CreatedAt time.Time `json:"created_at" gorm:"<-:false"`
UpdatedAt time.Time `json:"updated_at" gorm:"<-:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
// Targets is an array of scope targets stored as JSONB
// Each target contains exactly one resource type key (config, component, playbook, canary, or *)
// with a selector containing: agent, name, tagSelector fields
Targets types.JSON `json:"targets" gorm:"type:jsonb"`
}
Scope represents a collection of resources of a single type that can be used for access control and permissions
type ScrapePlugin ¶ added in v1.0.764
type ScrapePlugin struct {
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
Name string `json:"name"`
Namespace string `json:"namespace"`
Spec types.JSON `json:"spec,omitempty"`
Source string `json:"source,omitempty"`
CreatedBy *uuid.UUID `json:"created_by,omitempty"`
CreatedAt time.Time `json:"created_at" gorm:"<-:create"`
UpdatedAt *time.Time `json:"updated_at" gorm:"autoUpdateTime:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
func (ScrapePlugin) GetNamespace ¶ added in v1.0.894
func (s ScrapePlugin) GetNamespace() string
type ShortURL ¶ added in v1.0.965
type TaggableModel ¶ added in v1.0.826
type Team ¶ added in v1.0.115
type Team struct {
ID uuid.UUID `gorm:"default:generate_ulid()"`
Name string `gorm:"not null" json:"name"`
Icon string `json:"icon,omitempty"`
Spec types.JSON `json:"spec,omitempty"`
Source string `json:"source,omitempty"`
CreatedBy uuid.UUID `gorm:"not null" json:"created_by"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
type Topology ¶ added in v1.0.72
type Topology struct {
ID uuid.UUID `gorm:"default:generate_ulid()"`
AgentID uuid.UUID `json:"agent_id"`
Name string `json:"name"`
Namespace string `json:"namespace"`
Labels types.JSONStringMap `json:"labels,omitempty" gorm:"default:null"`
Source string `json:"source"`
Spec types.JSON `gorm:"default:null"`
Schedule *string `json:"schedule,omitempty"`
CreatedBy *uuid.UUID `json:"created_by,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty" time_format:"postgres_timestamp" gorm:"<-:create"`
UpdatedAt *time.Time `json:"updated_at,omitempty" time_format:"postgres_timestamp" gorm:"autoUpdateTime:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty" time_format:"postgres_timestamp"`
}
Topology represents the topologies database table
func (Topology) GetAgentID ¶ added in v1.0.1064
func (Topology) GetNamespace ¶ added in v1.0.894
func (Topology) GetUnpushed ¶ added in v1.0.362
func (Topology) OnConflictClause ¶ added in v1.0.438
func (t Topology) OnConflictClause() clause.OnConflict
type View ¶ added in v1.0.963
type View struct {
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
Name string `json:"name"`
Namespace string `json:"namespace" gorm:"default:NULL"`
Spec types.JSON `json:"spec"`
Source string `json:"source" gorm:"default:KubernetesCRD"`
Labels types.JSONStringMap `json:"labels,omitempty" gorm:"type:jsonb"`
CreatedBy *uuid.UUID `json:"created_by,omitempty"`
CreatedAt time.Time `json:"created_at" gorm:"<-:create"`
UpdatedAt *time.Time `json:"updated_at" gorm:"autoUpdateTime:false"`
Error *string `json:"error,omitempty" gorm:"default:NULL"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
View represents the views database table
func (View) GeneratedTableName ¶ added in v1.0.983
func (View) GetFieldsMatcher ¶ added in v1.0.1074
ResourceSelectable interface implementation for View Views only support namespace and name matching
func (View) GetLabelsMatcher ¶ added in v1.0.1074
func (View) GetNamespace ¶ added in v1.0.963
type ViewPanel ¶ added in v1.0.968
type ViewPanel struct {
ViewID uuid.UUID `json:"view_id" gorm:"primaryKey"`
RequestFingerprint string `json:"request_fingerprint" gorm:"primaryKey;default:''"`
AgentID uuid.UUID `json:"agent_id"`
IsPushed bool `json:"is_pushed" gorm:"default:false"`
// RefreshedAt is the last time this view was refreshed for this request fingerprint.
//
// NOTE: This is the refresh time of entire view (not just the panels. It also indicates the refresh time of the table)
RefreshedAt *time.Time `json:"refreshed_at,omitempty" gorm:"default:now()"`
// Results is a JSON array of panel results
Results types.JSON `json:"results"`
}
ViewPanel represents view panel data with push tracking
func (ViewPanel) GetUnpushed ¶ added in v1.0.983
GetUnpushed returns all unpushed ViewPanel records
Source Files
¶
- agents.go
- application.go
- artifacts.go
- canary.go
- changes.go
- checks.go
- clone.go
- comments.go
- common.go
- components.go
- config.go
- config_access.go
- config_change_dedupe.go
- config_cost.go
- connections.go
- event_queue.go
- evidences.go
- hypotheses.go
- incidents.go
- integrations.go
- invites.go
- job_history.go
- labels.go
- local_time.go
- logging_backends.go
- notifications.go
- people.go
- permission.go
- playbooks.go
- plugins.go
- properties.go
- responders.go
- scope.go
- scrape_plugin.go
- shorturl.go
- source.go
- teams.go
- topology.go
- view.go
- zz_generated.deepcopy.go