mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
Add description field to Query (#358)
This commit is contained in:
parent
cd7f925fdb
commit
4f83220870
@ -25,6 +25,7 @@ type QueryService interface {
|
||||
|
||||
type QueryPayload struct {
|
||||
Name *string
|
||||
Description *string
|
||||
Query *string
|
||||
Interval *uint
|
||||
Snapshot *bool
|
||||
@ -43,6 +44,7 @@ type Query struct {
|
||||
CreatedAt time.Time `json:"-"`
|
||||
UpdatedAt time.Time `json:"-"`
|
||||
Name string `json:"name" gorm:"not null;unique_index:idx_query_unique_name"`
|
||||
Description string `json:"description"`
|
||||
Query string `json:"query" gorm:"not null"`
|
||||
Interval uint `json:"interval"`
|
||||
Snapshot bool `json:"snapshot"`
|
||||
|
@ -20,6 +20,10 @@ func (svc service) NewQuery(ctx context.Context, p kolide.QueryPayload) (*kolide
|
||||
query.Name = *p.Name
|
||||
}
|
||||
|
||||
if p.Description != nil {
|
||||
query.Description = *p.Description
|
||||
}
|
||||
|
||||
if p.Query != nil {
|
||||
query.Query = *p.Query
|
||||
}
|
||||
@ -61,6 +65,10 @@ func (svc service) ModifyQuery(ctx context.Context, id uint, p kolide.QueryPaylo
|
||||
query.Name = *p.Name
|
||||
}
|
||||
|
||||
if p.Description != nil {
|
||||
query.Description = *p.Description
|
||||
}
|
||||
|
||||
if p.Query != nil {
|
||||
query.Query = *p.Query
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user