operations

package
v0.1.1-rc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2018 License: Apache-2.0, CC-BY-4.0, MIT Imports: 14 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DlaasAPI

type DlaasAPI struct {
	Middleware func(middleware.Builder) http.Handler

	// BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function.
	// It has a default implemention in the security package, however you can replace it for your particular usage.
	BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator
	// APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function.
	// It has a default implemention in the security package, however you can replace it for your particular usage.
	APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator
	// BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function.
	// It has a default implemention in the security package, however you can replace it for your particular usage.
	BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator

	// JSONConsumer registers a consumer for a "application/json" mime type
	JSONConsumer runtime.Consumer
	// MultipartformConsumer registers a consumer for a "multipart/form-data" mime type
	MultipartformConsumer runtime.Consumer

	// JSONProducer registers a producer for a "application/json" mime type
	JSONProducer runtime.Producer
	// BinProducer registers a producer for a "application/octet-stream" mime type
	BinProducer runtime.Producer

	// BasicAuthTokenAuth registers a function that takes a token and returns a principal
	// it performs authentication based on an api key Authorization provided in the header
	BasicAuthTokenAuth func(string) (interface{}, error)

	// WatsonAuthTokenAuth registers a function that takes a token and returns a principal
	// it performs authentication based on an api key X-Watson-Authorization-Token provided in the header
	WatsonAuthTokenAuth func(string) (interface{}, error)

	// WatsonAuthTokenQueryAuth registers a function that takes a token and returns a principal
	// it performs authentication based on an api key watson-token provided in the query
	WatsonAuthTokenQueryAuth func(string) (interface{}, error)

	// APIAuthorizer provides access control (ACL/RBAC/ABAC) by providing access to the request and authenticated principal
	APIAuthorizer runtime.Authorizer

	// EventsCreateEventEndpointHandler sets the operation handler for the create event endpoint operation
	EventsCreateEventEndpointHandler events.CreateEventEndpointHandler
	// EventsDeleteEventEndpointHandler sets the operation handler for the delete event endpoint operation
	EventsDeleteEventEndpointHandler events.DeleteEventEndpointHandler
	// ModelsDeleteModelHandler sets the operation handler for the delete model operation
	ModelsDeleteModelHandler models.DeleteModelHandler
	// ModelsDownloadModelDefinitionHandler sets the operation handler for the download model definition operation
	ModelsDownloadModelDefinitionHandler models.DownloadModelDefinitionHandler
	// ModelsDownloadTrainedModelHandler sets the operation handler for the download trained model operation
	ModelsDownloadTrainedModelHandler models.DownloadTrainedModelHandler
	// TrainingDataGetEMetricsHandler sets the operation handler for the get e metrics operation
	TrainingDataGetEMetricsHandler training_data.GetEMetricsHandler
	// EventsGetEventEndpointHandler sets the operation handler for the get event endpoint operation
	EventsGetEventEndpointHandler events.GetEventEndpointHandler
	// EventsGetEventTypeEndpointsHandler sets the operation handler for the get event type endpoints operation
	EventsGetEventTypeEndpointsHandler events.GetEventTypeEndpointsHandler
	// TrainingDataGetLoglinesHandler sets the operation handler for the get loglines operation
	TrainingDataGetLoglinesHandler training_data.GetLoglinesHandler
	// ModelsGetLogsHandler sets the operation handler for the get logs operation
	ModelsGetLogsHandler models.GetLogsHandler
	// ModelsGetMetricsHandler sets the operation handler for the get metrics operation
	ModelsGetMetricsHandler models.GetMetricsHandler
	// ModelsGetModelHandler sets the operation handler for the get model operation
	ModelsGetModelHandler models.GetModelHandler
	// ModelsListModelsHandler sets the operation handler for the list models operation
	ModelsListModelsHandler models.ListModelsHandler
	// ModelsPatchModelHandler sets the operation handler for the patch model operation
	ModelsPatchModelHandler models.PatchModelHandler
	// ModelsPostModelHandler sets the operation handler for the post model operation
	ModelsPostModelHandler models.PostModelHandler

	// ServeError is called when an error is received, there is a default handler
	// but you can set your own with this
	ServeError func(http.ResponseWriter, *http.Request, error)

	// ServerShutdown is called when the HTTP(S) server is shut down and done
	// handling all active connections and does not accept connections any more
	ServerShutdown func()

	// Custom command line argument groups with their descriptions
	CommandLineOptionsGroups []swag.CommandLineOptionsGroup

	// User defined logger function.
	Logger func(string, ...interface{})
	// contains filtered or unexported fields
}

DlaasAPI DLaaS enables deep learning (DL) highly scalable training of models for multiple frameworks on GPUs. The [DLaaS user guide](https://dlaas-guide.stage1.mybluemix.net/) provides more details on how to use the service, including examples.

func NewDlaasAPI

func NewDlaasAPI(spec *loads.Document) *DlaasAPI

NewDlaasAPI creates a new Dlaas instance

func (*DlaasAPI) AuthenticatorsFor

func (o *DlaasAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator

AuthenticatorsFor gets the authenticators for the specified security schemes

func (*DlaasAPI) Authorizer

func (o *DlaasAPI) Authorizer() runtime.Authorizer

Authorizer returns the registered authorizer

func (*DlaasAPI) ConsumersFor

func (o *DlaasAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer

ConsumersFor gets the consumers for the specified media types

func (*DlaasAPI) Context

func (o *DlaasAPI) Context() *middleware.Context

Context returns the middleware context for the dlaas API

func (*DlaasAPI) DefaultConsumes

func (o *DlaasAPI) DefaultConsumes() string

DefaultConsumes returns the default consumes media type

func (*DlaasAPI) DefaultProduces

func (o *DlaasAPI) DefaultProduces() string

DefaultProduces returns the default produces media type

func (*DlaasAPI) Formats

func (o *DlaasAPI) Formats() strfmt.Registry

Formats returns the registered string formats

func (*DlaasAPI) HandlerFor

func (o *DlaasAPI) HandlerFor(method, path string) (http.Handler, bool)

HandlerFor gets a http.Handler for the provided operation method and path

func (*DlaasAPI) Init

func (o *DlaasAPI) Init()

Init allows you to just initialize the handler cache, you can then recompose the middelware as you see fit

func (*DlaasAPI) ProducersFor

func (o *DlaasAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer

ProducersFor gets the producers for the specified media types

func (*DlaasAPI) RegisterFormat

func (o *DlaasAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)

RegisterFormat registers a custom format validator

func (*DlaasAPI) Serve

func (o *DlaasAPI) Serve(builder middleware.Builder) http.Handler

Serve creates a http handler to serve the API over HTTP can be used directly in http.ListenAndServe(":8000", api.Serve(nil))

func (*DlaasAPI) ServeErrorFor

func (o *DlaasAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)

ServeErrorFor gets a error handler for a given operation id

func (*DlaasAPI) SetDefaultConsumes

func (o *DlaasAPI) SetDefaultConsumes(mediaType string)

SetDefaultConsumes returns the default consumes media type

func (*DlaasAPI) SetDefaultProduces

func (o *DlaasAPI) SetDefaultProduces(mediaType string)

SetDefaultProduces sets the default produces media type

func (*DlaasAPI) SetSpec

func (o *DlaasAPI) SetSpec(spec *loads.Document)

SetSpec sets a spec that will be served for the clients.

func (*DlaasAPI) Validate

func (o *DlaasAPI) Validate() error

Validate validates the registrations in the DlaasAPI

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL