fleet/server/service/service_osquery_options.go
Zachary Wasserman c5f0e5a6b4
Add endpoints for apply/get of each spec type (#1752)
- Osquery Options (to be renamed to Options after current Options removed)
- Labels
- Queries
- Packs
2018-05-03 18:01:57 -07:00

26 lines
532 B
Go

package service
import (
"context"
"github.com/kolide/fleet/server/kolide"
"github.com/pkg/errors"
)
func (svc service) ApplyOptionsSpec(ctx context.Context, spec *kolide.OptionsSpec) error {
err := svc.ds.ApplyOptions(spec)
if err != nil {
return errors.Wrap(err, "apply options")
}
return nil
}
func (svc service) GetOptionsSpec(ctx context.Context) (*kolide.OptionsSpec, error) {
spec, err := svc.ds.GetOptions()
if err != nil {
return nil, errors.Wrap(err, "get options from datastore")
}
return spec, nil
}