Documentation ¶
Overview ¶
Package api defines all endpoints accessible from the yFuzz API.
Index ¶
- func CreateJob(r *http.Request, dependencies EndpointDependencies) (int, interface{})
- func DeleteJob(r *http.Request, dependencies EndpointDependencies) (int, interface{})
- func Endpoint(handler endpointFunc, dependencies EndpointDependencies) http.Handler
- func GetJobLogs(r *http.Request, dependencies EndpointDependencies) (int, interface{})
- func GetJobStatus(r *http.Request, dependencies EndpointDependencies) (int, interface{})
- func GetVersion(r *http.Request, _ EndpointDependencies) (int, interface{})
- func ListJobs(r *http.Request, dependencies EndpointDependencies) (int, interface{})
- type EndpointDependencies
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateJob ¶
func CreateJob(r *http.Request, dependencies EndpointDependencies) (int, interface{})
CreateJob creates new yFuzz jobs. Handler for POST /jobs
Body Parameters: - image: link to a docker image for a yFuzz job (string)
Response Fields: - job: name of the created job (string)
func DeleteJob ¶
func DeleteJob(r *http.Request, dependencies EndpointDependencies) (int, interface{})
DeleteJob removes yFuzz jobs. Handler for DELETE /jobs/:job
URL Parameters: - job: the name of the job (string)
Response Fields: - none
func Endpoint ¶
func Endpoint(handler endpointFunc, dependencies EndpointDependencies) http.Handler
Endpoint wraps an endpoint handler in some logic to catch errors and marshal a response to JSON
func GetJobLogs ¶
func GetJobLogs(r *http.Request, dependencies EndpointDependencies) (int, interface{})
GetJobLogs retrieves the logs for a specific job. Handler for GET /jobs/:job/logs
URL Parameters: - job: the name of the job (string)
Query Parameters: - crashes_only: only show crashes (boolean) - tail: number of tail lines to truncate the log to (int)
Response Fields: - logs: logs from jobs ([]string)
func GetJobStatus ¶
func GetJobStatus(r *http.Request, dependencies EndpointDependencies) (int, interface{})
GetJobStatus retrieves the status of all pods for a given job. Handler for GET /jobs/:job
URL Parameters: - job: the name of the job (string)
Response Fields: - crash_found: number of pods that found a crash (int) - no_crash: number of pods that timed out or hit the input limit with no crash (int) - pending: number of pods waiting to be scheduled (int) - running: number of pods currently running (int) - failed: number of pods that experienced an internal error (int) - unknown: number of pods that cannot be contacted (int)
func GetVersion ¶
func GetVersion(r *http.Request, _ EndpointDependencies) (int, interface{})
GetVersion retrieves the server version. Handler for GET /version
Parameters: - none
Response Fields: - version: version of the yFuzz server (string)
Types ¶
type EndpointDependencies ¶
type EndpointDependencies struct {
Kubernetes *kubernetes.API
}
EndpointDependencies holds objects endpoints rely on, such as a Kubernetes or database connection.