Documentation ¶
Index ¶
- Variables
- type AlertsController
- func (c AlertsController) CreateAlert(r *http.Request, vars RequestVars, body interface{}) *Response
- func (c AlertsController) DeleteAlert(r *http.Request, vars RequestVars, _ interface{}) *Response
- func (c AlertsController) GetAlert(r *http.Request, vars RequestVars, _ interface{}) *Response
- func (c AlertsController) ListAlerts(r *http.Request, vars RequestVars, _ interface{}) *Response
- func (c AlertsController) Routes() []Route
- func (c AlertsController) UpdateAlert(r *http.Request, vars RequestVars, body interface{}) *Response
- type AppContext
- type BaseController
- type Controller
- type EnsemblersController
- func (c EnsemblersController) CreateEnsembler(_ *http.Request, vars RequestVars, body interface{}) *Response
- func (c EnsemblersController) GetEnsembler(_ *http.Request, vars RequestVars, _ interface{}) *Response
- func (c EnsemblersController) ListEnsemblers(r *http.Request, vars RequestVars, _ interface{}) *Response
- func (c EnsemblersController) Routes() []Route
- func (c EnsemblersController) UpdateEnsembler(_ *http.Request, vars RequestVars, body interface{}) *Response
- type EnsemblersPathOptions
- type EnsemblingJobController
- func (c EnsemblingJobController) Create(r *http.Request, vars RequestVars, body interface{}) *Response
- func (c EnsemblingJobController) DeleteEnsemblingJob(_ *http.Request, vars RequestVars, _ interface{}) *Response
- func (c EnsemblingJobController) GetEnsemblingJob(_ *http.Request, vars RequestVars, _ interface{}) *Response
- func (c EnsemblingJobController) ListEnsemblingJobs(_ *http.Request, vars RequestVars, _ interface{}) *Response
- func (c EnsemblingJobController) Routes() []Route
- type ExperimentsController
- func (c ExperimentsController) ListExperimentEngineClients(r *http.Request, vars RequestVars, _ interface{}) *Response
- func (c ExperimentsController) ListExperimentEngineExperiments(r *http.Request, vars RequestVars, _ interface{}) *Response
- func (c ExperimentsController) ListExperimentEngineVariables(r *http.Request, vars RequestVars, _ interface{}) *Response
- func (c ExperimentsController) ListExperimentEngines(_ *http.Request, _ RequestVars, _ interface{}) *Response
- func (c ExperimentsController) Routes() []Route
- type GetEnsemblingJobOptions
- type Handler
- type PodLogController
- type ProjectsController
- type RequestVars
- type Response
- func Accepted(data interface{}) *Response
- func BadRequest(description, msg string) *Response
- func Created(data interface{}) *Response
- func Error(code int, description string, msg string) *Response
- func InternalServerError(description, msg string) *Response
- func NotFound(description, msg string) *Response
- func Ok(data interface{}) *Response
- type Route
- type RouterDeploymentController
- type RouterVersionsController
- func (c RouterVersionsController) CreateRouterVersion(r *http.Request, vars RequestVars, body interface{}) *Response
- func (c RouterVersionsController) DeleteRouterVersion(r *http.Request, vars RequestVars, _ interface{}) *Response
- func (c RouterVersionsController) DeployRouterVersion(r *http.Request, vars RequestVars, body interface{}) *Response
- func (c RouterVersionsController) GetRouterVersion(r *http.Request, vars RequestVars, _ interface{}) *Response
- func (c RouterVersionsController) ListRouterVersions(r *http.Request, vars RequestVars, _ interface{}) *Response
- func (c RouterVersionsController) Routes() []Route
- type RoutersController
- func (c RoutersController) CreateRouter(r *http.Request, vars RequestVars, body interface{}) *Response
- func (c RoutersController) DeleteRouter(r *http.Request, vars RequestVars, _ interface{}) *Response
- func (c RoutersController) DeployRouter(r *http.Request, vars RequestVars, body interface{}) *Response
- func (c RoutersController) GetRouter(r *http.Request, vars RequestVars, _ interface{}) *Response
- func (c RoutersController) ListRouterEvents(r *http.Request, vars RequestVars, body interface{}) *Response
- func (c RoutersController) ListRouters(r *http.Request, vars RequestVars, _ interface{}) *Response
- func (c RoutersController) Routes() []Route
- func (c RoutersController) UndeployRouter(r *http.Request, vars RequestVars, body interface{}) *Response
- func (c RoutersController) UpdateRouter(r *http.Request, vars RequestVars, body interface{}) *Response
Constants ¶
This section is empty.
Variables ¶
var ErrAlertDisabled = errors.New("alert is disabled in turing-api")
Functions ¶
This section is empty.
Types ¶
type AlertsController ¶
type AlertsController struct {
BaseController
}
func (AlertsController) CreateAlert ¶
func (c AlertsController) CreateAlert(r *http.Request, vars RequestVars, body interface{}) *Response
func (AlertsController) DeleteAlert ¶
func (c AlertsController) DeleteAlert(r *http.Request, vars RequestVars, _ interface{}) *Response
func (AlertsController) GetAlert ¶
func (c AlertsController) GetAlert(r *http.Request, vars RequestVars, _ interface{}) *Response
func (AlertsController) ListAlerts ¶
func (c AlertsController) ListAlerts(r *http.Request, vars RequestVars, _ interface{}) *Response
func (AlertsController) Routes ¶
func (c AlertsController) Routes() []Route
func (AlertsController) UpdateAlert ¶
func (c AlertsController) UpdateAlert(r *http.Request, vars RequestVars, body interface{}) *Response
type AppContext ¶
type AppContext struct { Authorizer *middleware.Authorizer // DAO DeploymentService service.DeploymentService RoutersService service.RoutersService RouterVersionsService service.RouterVersionsService EventService service.EventService EnsemblersService service.EnsemblersService EnsemblingJobService service.EnsemblingJobService AlertService service.AlertService // Default configuration for routers RouterDefaults *config.RouterDefaults BatchRunners []batchrunner.BatchJobRunner CryptoService service.CryptoService MLPService service.MLPService ExperimentsService service.ExperimentsService PodLogService service.PodLogService }
AppContext stores the entities relating to the application's context
func NewAppContext ¶
func NewAppContext( db *gorm.DB, cfg *config.Config, authorizer *middleware.Authorizer, vaultClient vault.VaultClient, ) (*AppContext, error)
NewAppContext is a creator for the app context
type BaseController ¶
type BaseController struct { *AppContext // contains filtered or unexported fields }
BaseController implements common methods that may be shared by all API controllers
func NewBaseController ¶
func NewBaseController(ctx *AppContext, validator *val.Validate) BaseController
NewBaseController returns a new instance of BaseController
func (BaseController) ParseVars ¶
func (c BaseController) ParseVars(dst interface{}, vars RequestVars) error
type Controller ¶
type Controller interface { // Routes returns the list of routes of this controller Routes() []Route }
type EnsemblersController ¶
type EnsemblersController struct {
BaseController
}
func (EnsemblersController) CreateEnsembler ¶
func (c EnsemblersController) CreateEnsembler( _ *http.Request, vars RequestVars, body interface{}, ) *Response
func (EnsemblersController) GetEnsembler ¶
func (c EnsemblersController) GetEnsembler( _ *http.Request, vars RequestVars, _ interface{}, ) *Response
func (EnsemblersController) ListEnsemblers ¶
func (c EnsemblersController) ListEnsemblers( r *http.Request, vars RequestVars, _ interface{}, ) *Response
func (EnsemblersController) Routes ¶
func (c EnsemblersController) Routes() []Route
func (EnsemblersController) UpdateEnsembler ¶
func (c EnsemblersController) UpdateEnsembler( _ *http.Request, vars RequestVars, body interface{}, ) *Response
type EnsemblersPathOptions ¶
type EnsemblingJobController ¶
type EnsemblingJobController struct {
BaseController
}
EnsemblingJobController is the HTTP controller that handles the orchestration of ensembling jobs.
func (EnsemblingJobController) Create ¶
func (c EnsemblingJobController) Create( r *http.Request, vars RequestVars, body interface{}, ) *Response
Create is a HTTP Post Method that creates an Ensembling job. This method will only return the acceptance/rejection of the job rather than the actual result of the job.
func (EnsemblingJobController) DeleteEnsemblingJob ¶
func (c EnsemblingJobController) DeleteEnsemblingJob( _ *http.Request, vars RequestVars, _ interface{}, ) *Response
DeleteEnsemblingJob deletes and ensembling job and cancels any ongoing process.
func (EnsemblingJobController) GetEnsemblingJob ¶
func (c EnsemblingJobController) GetEnsemblingJob( _ *http.Request, vars RequestVars, _ interface{}, ) *Response
GetEnsemblingJob is HTTP handler that will get a single EnsemblingJob
func (EnsemblingJobController) ListEnsemblingJobs ¶
func (c EnsemblingJobController) ListEnsemblingJobs( _ *http.Request, vars RequestVars, _ interface{}, ) *Response
ListEnsemblingJobs is HTTP handler that will get a list of EnsemblingJobs
func (EnsemblingJobController) Routes ¶
func (c EnsemblingJobController) Routes() []Route
Routes returns all the HTTP routes given by the EnsemblingJobController.
type ExperimentsController ¶
type ExperimentsController struct {
BaseController
}
ExperimentsController implements the handlers for experiment related APIs
func (ExperimentsController) ListExperimentEngineClients ¶
func (c ExperimentsController) ListExperimentEngineClients( r *http.Request, vars RequestVars, _ interface{}, ) *Response
ListExperimentEngineClients returns a list of clients on the given experiment engine
func (ExperimentsController) ListExperimentEngineExperiments ¶
func (c ExperimentsController) ListExperimentEngineExperiments( r *http.Request, vars RequestVars, _ interface{}, ) *Response
ListExperimentEngineExperiments returns a list of experiments on the given experiment engine, optionally tied to the given client id
func (ExperimentsController) ListExperimentEngineVariables ¶
func (c ExperimentsController) ListExperimentEngineVariables( r *http.Request, vars RequestVars, _ interface{}, ) *Response
ListExperimentEngineVariables returns a list of variables for the given client and/or experiments
func (ExperimentsController) ListExperimentEngines ¶
func (c ExperimentsController) ListExperimentEngines( _ *http.Request, _ RequestVars, _ interface{}, ) *Response
ListExperimentEngines returns a list of available experiment engines
func (ExperimentsController) Routes ¶
func (c ExperimentsController) Routes() []Route
type GetEnsemblingJobOptions ¶
type GetEnsemblingJobOptions struct { ProjectID *models.ID `schema:"project_id" validate:"required"` ID *models.ID `schema:"job_id" validate:"required"` }
GetEnsemblingJobOptions is the options that can be parsed from query params for the GET ensembling job method
type Handler ¶
type Handler func(r *http.Request, vars RequestVars, body interface{}) *Response
Handler is a function that returns a Response given the request.
type PodLogController ¶
type PodLogController struct {
BaseController
}
func (PodLogController) ListEnsemblingJobPodLogs ¶
func (c PodLogController) ListEnsemblingJobPodLogs(_ *http.Request, vars RequestVars, _ interface{}) *Response
ListEnsemblingJobPodLogs handles the HTTP request for getting Ensembling Pod Logs It supports 3 types of pods:
- Image Builder
- Spark Driver
- Spark Executor
func (PodLogController) ListRouterPodLogs ¶
func (c PodLogController) ListRouterPodLogs(_ *http.Request, vars RequestVars, _ interface{}) *Response
ListRouterPodLogs handles the HTTP request for getting Router Pod Logs It supports 3 types of pods:
- Router
- Enricher
- Ensembler
func (PodLogController) Routes ¶
func (c PodLogController) Routes() []Route
type ProjectsController ¶
type ProjectsController struct {
BaseController
}
func (ProjectsController) ListProjects ¶
func (c ProjectsController) ListProjects( r *http.Request, vars RequestVars, _ interface{}, ) *Response
func (ProjectsController) Routes ¶
func (c ProjectsController) Routes() []Route
type RequestVars ¶
RequestVars is an alias of map[string][]string This is done to make it compatible with *http.Request.URL.Query() return type and also to make it possible to use it with gorilla/schema Decoder
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response contains the return code and data to return to the caller.
func Accepted ¶
func Accepted(data interface{}) *Response
Accepted returns an Response with status code 202.
func BadRequest ¶
BadRequest returns an Response with the error code 400.
func Created ¶
func Created(data interface{}) *Response
Created returns an Response with status code 201.
func InternalServerError ¶
InternalServerError returns an Response with the error code 500.
func (*Response) MarshalJSON ¶
MarshalJSON is a custom marshaler for the unexported fields
func (*Response) WriteTo ¶
func (r *Response) WriteTo(w http.ResponseWriter)
WriteTo writes a Response to the provided http.ResponseWriter.
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
Route is a http route for the API.
func (Route) HandlerFunc ¶
func (route Route) HandlerFunc(validator *validator.Validate) http.HandlerFunc
HandlerFunc returns the HandlerFunc for this route, which validates the request and executes the route's Handler on the request, returning its response.
type RouterDeploymentController ¶
type RouterDeploymentController struct {
BaseController
}
RouterDeploymentController handles the deployment of routers
type RouterVersionsController ¶
type RouterVersionsController struct {
RouterDeploymentController
}
func (RouterVersionsController) CreateRouterVersion ¶
func (c RouterVersionsController) CreateRouterVersion(r *http.Request, vars RequestVars, body interface{}) *Response
CreateRouterVersion creates a router version from the provided configuration. If no router exists within the provided project with the provided id, this method will throw an error. If the update is valid, a new RouterVersion will be created but NOT deployed.
func (RouterVersionsController) DeleteRouterVersion ¶
func (c RouterVersionsController) DeleteRouterVersion( r *http.Request, vars RequestVars, _ interface{}, ) *Response
DeleteRouterVersion deletes the config for the given version number.
func (RouterVersionsController) DeployRouterVersion ¶
func (c RouterVersionsController) DeployRouterVersion( r *http.Request, vars RequestVars, body interface{}, ) *Response
DeployRouterVersion deploys the given router version into the associated kubernetes cluster
func (RouterVersionsController) GetRouterVersion ¶
func (c RouterVersionsController) GetRouterVersion( r *http.Request, vars RequestVars, _ interface{}, ) *Response
GetRouterVersion gets the router version for the provided router id and version number.
func (RouterVersionsController) ListRouterVersions ¶
func (c RouterVersionsController) ListRouterVersions( r *http.Request, vars RequestVars, _ interface{}, ) *Response
ListRouterVersions lists the router versions of the provided router.
func (RouterVersionsController) Routes ¶
func (c RouterVersionsController) Routes() []Route
type RoutersController ¶
type RoutersController struct {
RouterDeploymentController
}
func (RoutersController) CreateRouter ¶
func (c RoutersController) CreateRouter( r *http.Request, vars RequestVars, body interface{}, ) *Response
CreateRouter creates a router from the provided configuration. If there already exists a router within the provided project with the same name, this method will throw an error. If not, a new Router and associated RouterVersion will be created and deployed.
func (RoutersController) DeleteRouter ¶
func (c RoutersController) DeleteRouter( r *http.Request, vars RequestVars, _ interface{}, ) *Response
DeleteRouter deletes a router and all its associated versions.
func (RoutersController) DeployRouter ¶
func (c RoutersController) DeployRouter( r *http.Request, vars RequestVars, body interface{}, ) *Response
DeployRouter deploys the current version of the given router into the associated kubernetes cluster. If there is no current version, an error is returned.
func (RoutersController) GetRouter ¶
func (c RoutersController) GetRouter( r *http.Request, vars RequestVars, _ interface{}, ) *Response
GetRouter gets a router matching the provided routerID.
func (RoutersController) ListRouterEvents ¶
func (c RoutersController) ListRouterEvents(r *http.Request, vars RequestVars, body interface{}, ) *Response
func (RoutersController) ListRouters ¶
func (c RoutersController) ListRouters( r *http.Request, vars RequestVars, _ interface{}, ) *Response
ListRouters lists all routers configured in the provided project. If none are found, an error will be thrown.
func (RoutersController) Routes ¶
func (c RoutersController) Routes() []Route
func (RoutersController) UndeployRouter ¶
func (c RoutersController) UndeployRouter( r *http.Request, vars RequestVars, body interface{}, ) *Response
UndeployRouter deletes the given router specs from the associated kubernetes cluster
func (RoutersController) UpdateRouter ¶
func (c RoutersController) UpdateRouter(r *http.Request, vars RequestVars, body interface{}) *Response
UpdateRouter updates a router from the provided configuration. If no router exists within the provided project with the provided id, this method will throw an error. If the update is valid, a new RouterVersion will be created and deployed.