Documentation
¶
Overview ¶
Package server Skydive API
The Skydive REST API allows to communicate with a Skydive analyzer.
Schemes: http, https Host: localhost:8082 BasePath: /api Version: 0.28.0 License: Apache http://opensource.org/licenses/Apache-2.0 Contact: Skydive mailing list <skydive-dev@redhat.com> Consumes: - application/json Produces: - application/json - text/plain
swagger:meta
Index ¶
- Variables
- func NewRuntime(g *graph.Graph, tr *traversal.GremlinTraversalParser, server *Server, ...) (*js.Runtime, error)
- func RegisterStatusAPI(s *shttp.Server, r StatusReporter, authBackend shttp.AuthenticationBackend)
- func RegisterTopologyAPI(r *shttp.Server, g *graph.Graph, parser *traversal.GremlinTraversalParser, ...)
- type AlertAPIHandler
- type AlertResourceHandler
- type EdgeAPIHandler
- func (h *EdgeAPIHandler) Create(resource rest.Resource, createOpts *rest.CreateOptions) error
- func (h *EdgeAPIHandler) Decorate(resource rest.Resource)
- func (h *EdgeAPIHandler) Delete(id string) error
- func (h *EdgeAPIHandler) Get(id string) (rest.Resource, bool)
- func (h *EdgeAPIHandler) Index() map[string]rest.Resource
- func (h *EdgeAPIHandler) Name() string
- func (h *EdgeAPIHandler) New() rest.Resource
- func (h *EdgeAPIHandler) Update(id string, resource rest.Resource) (rest.Resource, bool, error)
- type EdgeResourceHandler
- type Info
- type NodeAPIHandler
- func (h *NodeAPIHandler) Create(resource rest.Resource, createOpts *rest.CreateOptions) error
- func (h *NodeAPIHandler) Decorate(resource rest.Resource)
- func (h *NodeAPIHandler) Delete(id string) error
- func (h *NodeAPIHandler) Get(id string) (rest.Resource, bool)
- func (h *NodeAPIHandler) Index() map[string]rest.Resource
- func (h *NodeAPIHandler) Name() string
- func (h *NodeAPIHandler) New() rest.Resource
- func (h *NodeAPIHandler) Update(id string, resource rest.Resource) (rest.Resource, bool, error)
- type NodeResourceHandler
- type ResourceNotFound
- type Server
- type StatusReporter
- type TopologyAPI
- type TopologyMarshaller
- type TopologyMarshallers
- type Validator
- type WorkflowAPIHandler
- type WorkflowResourceHandler
Constants ¶
This section is empty.
Variables ¶
var StaticWorkflows []*types.Workflow
StaticWorkflows holds a list of hardcoded workflows
Functions ¶
func NewRuntime ¶
func NewRuntime(g *graph.Graph, tr *traversal.GremlinTraversalParser, server *Server, assets assets.Assets) (*js.Runtime, error)
NewRuntime returns a new JavaScript runtime where accesses to resources are done directly using the handlers, not through HTTP requests.
func RegisterStatusAPI ¶
func RegisterStatusAPI(s *shttp.Server, r StatusReporter, authBackend shttp.AuthenticationBackend)
RegisterStatusAPI registers the status API endpoint
func RegisterTopologyAPI ¶
func RegisterTopologyAPI(r *shttp.Server, g *graph.Graph, parser *traversal.GremlinTraversalParser, authBackend shttp.AuthenticationBackend, extraMarshallers map[string]TopologyMarshaller)
RegisterTopologyAPI registers a new topology query API
Types ¶
type AlertAPIHandler ¶
type AlertAPIHandler struct {
rest.BasicAPIHandler
}
AlertAPIHandler aims to exposes the Alert API.
func RegisterAlertAPI ¶
func RegisterAlertAPI(apiServer *Server, authBackend shttp.AuthenticationBackend) *AlertAPIHandler
RegisterAlertAPI registers an Alert's API to a designated API Server
type AlertResourceHandler ¶
type AlertResourceHandler struct {
rest.ResourceHandler
}
AlertResourceHandler aims to creates and manage a new Alert.
func (*AlertResourceHandler) Name ¶
func (a *AlertResourceHandler) Name() string
Name returns resource name "alert"
func (*AlertResourceHandler) New ¶
func (a *AlertResourceHandler) New() rest.Resource
New creates a new alert
type EdgeAPIHandler ¶
type EdgeAPIHandler struct {
// contains filtered or unexported fields
}
EdgeAPIHandler aims to exposes the Alert API.
func RegisterEdgeAPI ¶
func RegisterEdgeAPI(apiServer *Server, g *graph.Graph, authBackend shttp.AuthenticationBackend) *EdgeAPIHandler
RegisterEdgeAPI registers the edge API
func (*EdgeAPIHandler) Create ¶
func (h *EdgeAPIHandler) Create(resource rest.Resource, createOpts *rest.CreateOptions) error
Create adds the specified edge to the graph
func (*EdgeAPIHandler) Decorate ¶
func (h *EdgeAPIHandler) Decorate(resource rest.Resource)
Decorate the specified edge
func (*EdgeAPIHandler) Delete ¶
func (h *EdgeAPIHandler) Delete(id string) error
Delete the edge with the specified id from the graph
func (*EdgeAPIHandler) Get ¶
func (h *EdgeAPIHandler) Get(id string) (rest.Resource, bool)
Get returns a edge with the specified id
func (*EdgeAPIHandler) Index ¶
func (h *EdgeAPIHandler) Index() map[string]rest.Resource
Index returns the list of existing edges
func (*EdgeAPIHandler) Name ¶
func (h *EdgeAPIHandler) Name() string
Name returns resource name "edge"
type EdgeResourceHandler ¶
type EdgeResourceHandler struct {
rest.ResourceHandler
}
EdgeResourceHandler aims to creates and manage a new Alert.
type Info ¶
type Info struct { // Server host ID Host string // API version Version string // Service type Service string }
Info for each host describes his API version and service swagger:model
type NodeAPIHandler ¶
type NodeAPIHandler struct {
// contains filtered or unexported fields
}
NodeAPIHandler aims to exposes the Alert API.
func RegisterNodeAPI ¶
func RegisterNodeAPI(apiServer *Server, g *graph.Graph, authBackend shttp.AuthenticationBackend) *NodeAPIHandler
RegisterNodeAPI registers the node API
func (*NodeAPIHandler) Create ¶
func (h *NodeAPIHandler) Create(resource rest.Resource, createOpts *rest.CreateOptions) error
Create adds the specified node to the graph
func (*NodeAPIHandler) Decorate ¶
func (h *NodeAPIHandler) Decorate(resource rest.Resource)
Decorate the specified node
func (*NodeAPIHandler) Delete ¶
func (h *NodeAPIHandler) Delete(id string) error
Delete the node with the specified id from the graph
func (*NodeAPIHandler) Get ¶
func (h *NodeAPIHandler) Get(id string) (rest.Resource, bool)
Get returns a node with the specified id
func (*NodeAPIHandler) Index ¶
func (h *NodeAPIHandler) Index() map[string]rest.Resource
Index returns the list of existing nodes
func (*NodeAPIHandler) Name ¶
func (h *NodeAPIHandler) Name() string
Name returns resource name "node"
type NodeResourceHandler ¶
type NodeResourceHandler struct {
rest.ResourceHandler
}
NodeResourceHandler aims to creates and manage a new Alert.
type ResourceNotFound ¶
ResourceNotFound error generated when a resource does not exists
func (ResourceNotFound) Error ¶
func (r ResourceNotFound) Error() string
type Server ¶
type Server struct { HTTPServer *shttp.Server EtcdClient *etcdclient.Client // contains filtered or unexported fields }
Server defines an API server
func NewAPI ¶
func NewAPI(server *shttp.Server, etcdClient *etcdclient.Client, version, hostID string, kind service.Type, authBackend shttp.AuthenticationBackend, validator Validator) (*Server, error)
NewAPI creates a new API server based on http
func (*Server) GetHandler ¶
GetHandler returns the hander named hname
func (*Server) RegisterAPIHandler ¶
func (a *Server) RegisterAPIHandler(handler rest.Handler, authBackend shttp.AuthenticationBackend)
RegisterAPIHandler registers a new handler for an API
type StatusReporter ¶
type StatusReporter interface {
GetStatus() interface{}
}
StatusReporter is the interface to report the status of a service
type TopologyAPI ¶
type TopologyAPI struct {
// contains filtered or unexported fields
}
TopologyAPI exposes the topology query API
type TopologyMarshaller ¶
type TopologyMarshaller func(traversal.GraphTraversalStep, io.Writer) error
TopologyMarshaller is used to output a gremlin step into a specific format
type TopologyMarshallers ¶
type TopologyMarshallers map[string]TopologyMarshaller
TopologyMarshallers maps Accept headers to topology marshallers
type WorkflowAPIHandler ¶
type WorkflowAPIHandler struct { rest.BasicAPIHandler // contains filtered or unexported fields }
WorkflowAPIHandler based on BasicAPIHandler
func RegisterWorkflowAPI ¶
func RegisterWorkflowAPI(apiServer *Server, g *graph.Graph, parser *traversal.GremlinTraversalParser, authBackend shttp.AuthenticationBackend, runtime *js.Runtime) (*WorkflowAPIHandler, error)
RegisterWorkflowAPI registers a new workflow api handler
func (*WorkflowAPIHandler) Create ¶
func (w *WorkflowAPIHandler) Create(r rest.Resource, opts *rest.CreateOptions) error
Create tests whether the resource is a duplicate or is unique
type WorkflowResourceHandler ¶
type WorkflowResourceHandler struct { }
WorkflowResourceHandler describes a workflow resource handler
func (*WorkflowResourceHandler) Name ¶
func (w *WorkflowResourceHandler) Name() string
Name return "workflow"
func (*WorkflowResourceHandler) New ¶
func (w *WorkflowResourceHandler) New() rest.Resource
New creates a new workflow resource