README
¶
snap REST API
Task Schema
This is used in REST, and in a file format for the cli.
---
version: 1
task:
schedule:
type: simple
interval: 5s
deadline: 5s
config:
/intel/mock:
- key: password
value: j3rr
workflow:
collect:
metric_types:
- namespace: /intel/mock/foo
- namespace: /intel/mock/bar
publish:
- plugin:
name: "influx"
version: 2
process:
- plugin:
name: "averager"
publish:
- plugin:
name: "rabbitmq"
version: 1
{
"version": 1,
"task": {
"schedule": {
"type": "simple",
"interval": "5s"
},
"deadline": "5s",
"config": {
"/intel/mock": [
{
"key": "password",
"value": "j3rr"
}
]
},
"workflow": {
"collect": {
"metric_types": [
{
"namespace": "/intel/mock/foo"
},
{
"namespace": "/intel/mock/bar"
}
],
"publish": [
{
"plugin": {
"name": "influx",
"version": 2
}
}
],
"process": [
{
"plugin": {
"name": "averager"
},
"publish": [
{
"plugin": {
"name": "rabbitmq",
"version": 1
}
}
]
}
]
}
}
}
}
Documentation
¶
Index ¶
- Constants
- Variables
- type Logger
- type Server
- func (s *Server) BindConfigManager(c managesConfig)
- func (s *Server) BindMetricManager(m managesMetrics)
- func (s *Server) BindTaskManager(t managesTasks)
- func (s *Server) BindTribeManager(t managesTribe)
- func (s *Server) Err() <-chan error
- func (s *Server) Port() int
- func (s *Server) Start(addrString string) error
- type TaskWatchHandler
Constants ¶
View Source
const (
APIVersion = 1
)
View Source
const PluginAlreadyLoaded = "plugin is already loaded"
Variables ¶
View Source
var ( ErrMissingPluginName = errors.New("missing plugin name") ErrPluginNotFound = errors.New("plugin not found") )
View Source
var ( // The amount of time to buffer streaming events before flushing in seconds StreamingBufferWindow = 0.1 ErrStreamingUnsupported = errors.New("Streaming unsupported") ErrTaskNotFound = errors.New("Task not found") ErrTaskDisabledNotRunnable = errors.New("Task is disabled. Cannot be started") )
View Source
var ( ErrInvalidJSON = errors.New("Invalid JSON") ErrAgreementDoesNotExist = errors.New("Agreement not found") ErrMemberNotFound = errors.New("Member not found") )
View Source
var (
ErrBadCert = errors.New("Invalid certificate given")
)
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a snap middleware that logs to a logrus facility
func (*Logger) ServeHTTP ¶
func (l *Logger) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) BindConfigManager ¶
func (s *Server) BindConfigManager(c managesConfig)
func (*Server) BindMetricManager ¶
func (s *Server) BindMetricManager(m managesMetrics)
func (*Server) BindTaskManager ¶
func (s *Server) BindTaskManager(t managesTasks)
func (*Server) BindTribeManager ¶
func (s *Server) BindTribeManager(t managesTribe)
type TaskWatchHandler ¶
type TaskWatchHandler struct {
// contains filtered or unexported fields
}
func (*TaskWatchHandler) CatchCollection ¶
func (t *TaskWatchHandler) CatchCollection(m []core.Metric)
func (*TaskWatchHandler) CatchTaskDisabled ¶
func (t *TaskWatchHandler) CatchTaskDisabled(why string)
func (*TaskWatchHandler) CatchTaskStarted ¶
func (t *TaskWatchHandler) CatchTaskStarted()
func (*TaskWatchHandler) CatchTaskStopped ¶
func (t *TaskWatchHandler) CatchTaskStopped()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.