2016-12-13 22:22:05 +00:00
|
|
|
package kolide
|
|
|
|
|
|
|
|
import (
|
|
|
|
"golang.org/x/net/context"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ScheduledQueryStore interface {
|
|
|
|
NewScheduledQuery(sq *ScheduledQuery) (*ScheduledQuery, error)
|
|
|
|
SaveScheduledQuery(sq *ScheduledQuery) (*ScheduledQuery, error)
|
|
|
|
DeleteScheduledQuery(id uint) error
|
|
|
|
ScheduledQuery(id uint) (*ScheduledQuery, error)
|
|
|
|
ListScheduledQueriesInPack(id uint, opts ListOptions) ([]*ScheduledQuery, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
type ScheduledQueryService interface {
|
2017-01-10 04:40:21 +00:00
|
|
|
GetScheduledQuery(ctx context.Context, id uint) (query *ScheduledQuery, err error)
|
|
|
|
GetScheduledQueriesInPack(ctx context.Context, id uint, opts ListOptions) (queries []*ScheduledQuery, err error)
|
|
|
|
ScheduleQuery(ctx context.Context, sq *ScheduledQuery) (query *ScheduledQuery, err error)
|
|
|
|
DeleteScheduledQuery(ctx context.Context, id uint) (err error)
|
|
|
|
ModifyScheduledQuery(ctx context.Context, sq *ScheduledQuery) (query *ScheduledQuery, err error)
|
2016-12-13 22:22:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ScheduledQuery struct {
|
|
|
|
UpdateCreateTimestamps
|
|
|
|
DeleteFields
|
2016-12-14 22:29:20 +00:00
|
|
|
ID uint `json:"id"`
|
2016-12-13 22:22:05 +00:00
|
|
|
PackID uint `json:"pack_id" db:"pack_id"`
|
|
|
|
QueryID uint `json:"query_id" db:"query_id"`
|
|
|
|
Query string `json:"query"` // populated via a join on queries
|
|
|
|
Name string `json:"name"` // populated via a join on queries
|
|
|
|
Interval uint `json:"interval"`
|
|
|
|
Snapshot *bool `json:"snapshot"`
|
|
|
|
Removed *bool `json:"removed"`
|
|
|
|
Platform *string `json:"platform"`
|
|
|
|
Version *string `json:"version"`
|
|
|
|
Shard *uint `json:"shard"`
|
|
|
|
}
|