Documentation
¶
Index ¶
- type APIServer
- func (s *APIServer) AddCapabilityCenter(c *gin.Context)
- func (s *APIServer) AddCapabilityIntoCluster(c *gin.Context)
- func (s *APIServer) AttachTrait(c *gin.Context)
- func (s *APIServer) CreateApplication(c *gin.Context)
- func (s *APIServer) CreateEnv(c *gin.Context)
- func (s *APIServer) CreateScope(c *gin.Context)
- func (s *APIServer) DeleteApps(c *gin.Context)
- func (s *APIServer) DeleteCapabilityCenter(c *gin.Context)
- func (s *APIServer) DeleteComponent(c *gin.Context)
- func (s *APIServer) DeleteEnv(c *gin.Context)
- func (s *APIServer) DeleteScope(c *gin.Context)
- func (s *APIServer) DetachTrait(c *gin.Context)
- func (s *APIServer) DoAttachTrait(c context.Context, body apis.TraitBody) (string, error)
- func (s *APIServer) DoDetachTrait(c context.Context, envName string, traitType string, componentName string, ...) (string, error)
- func (s *APIServer) GetApp(c *gin.Context)
- func (s *APIServer) GetComponent(c *gin.Context)
- func (s *APIServer) GetDefinition(c *gin.Context)
- func (s *APIServer) GetEnv(c *gin.Context)
- func (s *APIServer) GetScope(c *gin.Context)
- func (s *APIServer) GetTrait(c *gin.Context)
- func (s *APIServer) GetVersion(c *gin.Context)
- func (s *APIServer) GetWorkload(c *gin.Context)
- func (s *APIServer) Launch(errChan chan<- error)
- func (s *APIServer) ListApps(c *gin.Context)
- func (s *APIServer) ListCapabilities(c *gin.Context)
- func (s *APIServer) ListCapabilityCenters(c *gin.Context)
- func (s *APIServer) ListEnv(c *gin.Context)
- func (s *APIServer) ListScope(c *gin.Context)
- func (s *APIServer) ListTrait(c *gin.Context)
- func (s *APIServer) ListWorkload(c *gin.Context)
- func (s *APIServer) RemoveCapabilityFromCluster(c *gin.Context)
- func (s *APIServer) SetEnv(c *gin.Context)
- func (s *APIServer) Shutdown(ctx context.Context) error
- func (s *APIServer) SwaggerJSON(c *gin.Context)
- func (s *APIServer) SyncCapabilityCenter(c *gin.Context)
- func (s *APIServer) UpdateApps(c *gin.Context)
- func (s *APIServer) UpdateEnv(c *gin.Context)
- func (s *APIServer) UpdateScope(c *gin.Context)
- func (s *APIServer) UpdateWorkload(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIServer ¶
type APIServer struct {
KubeClient client.Client
// contains filtered or unexported fields
}
APIServer run a restful API server for dashboard
func New ¶ added in v0.1.1
func New(c types.Args, port, staticPath string) (*APIServer, error)
New will create APIServer
func (*APIServer) AddCapabilityCenter ¶ added in v0.1.1
func (s *APIServer) AddCapabilityCenter(c *gin.Context)
AddCapabilityCenter adds and synchronizes a capability center from remote
func (*APIServer) AddCapabilityIntoCluster ¶ added in v0.1.1
func (s *APIServer) AddCapabilityIntoCluster(c *gin.Context)
AddCapabilityIntoCluster adds specific capability into cluster
func (*APIServer) AttachTrait ¶ added in v0.1.1
func (s *APIServer) AttachTrait(c *gin.Context)
AttachTrait attaches a trait to a component
func (*APIServer) CreateApplication ¶ added in v0.3.1
func (s *APIServer) CreateApplication(c *gin.Context)
CreateApplication creates an application @tags applications @ID CreateApplication @Summary creates an application @Param envName path string true "environment name" @Param body body appfile.AppFile true "application parameters" @Success 200 {object} apis.Response{code=int,data=string} @Failure 500 {object} apis.Response{code=int,data=string} @Router /envs/{envName}/apps [post]
func (*APIServer) CreateEnv ¶ added in v0.1.1
func (s *APIServer) CreateEnv(c *gin.Context)
CreateEnv creates an environment @Tags environments @ID createEnvironment @Success 200 {object} apis.Response{code=int,data=string} @Failure 500 {object} apis.Response{code=int,data=string} @Router /envs/ [post]
func (*APIServer) CreateScope ¶ added in v0.1.1
func (s *APIServer) CreateScope(c *gin.Context)
CreateScope creates a scope
func (*APIServer) DeleteApps ¶ added in v0.1.1
func (s *APIServer) DeleteApps(c *gin.Context)
DeleteApps deletes an application by the namespaced name in the gin.Context
func (*APIServer) DeleteCapabilityCenter ¶ added in v0.1.1
func (s *APIServer) DeleteCapabilityCenter(c *gin.Context)
DeleteCapabilityCenter deltes a capability cernter already added
func (*APIServer) DeleteComponent ¶ added in v0.1.1
func (s *APIServer) DeleteComponent(c *gin.Context)
DeleteComponent deletes a component from cluster
func (*APIServer) DeleteEnv ¶ added in v0.1.1
func (s *APIServer) DeleteEnv(c *gin.Context)
DeleteEnv delete an environment @Tags environments @ID deleteEnvironment @Param envName path string true "envName" @Success 200 {object} apis.Response{code=int,data=string} @Failure 500 {object} apis.Response{code=int,data=string} @Router /envs/{envName} [delete]
func (*APIServer) DeleteScope ¶ added in v0.1.1
func (s *APIServer) DeleteScope(c *gin.Context)
DeleteScope deletes a scope
func (*APIServer) DetachTrait ¶ added in v0.1.1
func (s *APIServer) DetachTrait(c *gin.Context)
DetachTrait detaches a trait from a component
func (*APIServer) DoAttachTrait ¶ added in v0.1.1
func (s *APIServer) DoAttachTrait(c context.Context, body apis.TraitBody) (string, error)
DoAttachTrait executes attaching trait operation
func (*APIServer) DoDetachTrait ¶ added in v0.1.1
func (s *APIServer) DoDetachTrait(c context.Context, envName string, traitType string, componentName string, appName string, staging bool) (string, error)
DoDetachTrait executes detaching trait operation
func (*APIServer) GetApp ¶ added in v0.1.1
func (s *APIServer) GetApp(c *gin.Context)
GetApp requests an application by the namespaced name in the gin.Context
func (*APIServer) GetComponent ¶ added in v0.1.1
func (s *APIServer) GetComponent(c *gin.Context)
GetComponent gets a comoponent from cluster
func (*APIServer) GetDefinition ¶ added in v0.3.0
func (s *APIServer) GetDefinition(c *gin.Context)
GetDefinition gets OpenAPI schema from Cue section of a WorkloadDefinition/TraitDefinition @tags definitions @ID GetDefinition @Summary gets OpenAPI schema from Cue section of a WorkloadDefinition/TraitDefinition @Param definitionName path string true "name of workload type or trait" @Success 200 {object} apis.Response{code=int,data=string} @Failure 500 {object} apis.Response{code=int,data=string} @Router /definitions/{definitionName} [get]
func (*APIServer) GetEnv ¶ added in v0.1.1
func (s *APIServer) GetEnv(c *gin.Context)
GetEnv gets an environment @Tags environments @ID getEnvironment @Param envName path string true "envName" @Success 200 {object} apis.Response{code=int,data=[]apis.Environment} @Failure 500 {object} apis.Response{code=int,data=string} @Router /envs/{envName} [get]
func (*APIServer) GetScope ¶ added in v0.1.1
func (s *APIServer) GetScope(c *gin.Context)
GetScope gets a scope
func (*APIServer) GetTrait ¶ added in v0.1.1
func (s *APIServer) GetTrait(c *gin.Context)
GetTrait gets a trait by name
func (*APIServer) GetVersion ¶ added in v0.1.1
func (s *APIServer) GetVersion(c *gin.Context)
GetVersion will return version for dashboard
func (*APIServer) GetWorkload ¶ added in v0.1.1
func (s *APIServer) GetWorkload(c *gin.Context)
GetWorkload gets a workload by name
func (*APIServer) Launch ¶
func (s *APIServer) Launch(errChan chan<- error)
Launch will start the apiserver
func (*APIServer) ListApps ¶ added in v0.1.1
func (s *APIServer) ListApps(c *gin.Context)
ListApps requests a list of application by the namespace in the gin.Context @tags applications @ID ListApplications @Summary list all applications @Param envName path string true "environment name" @Success 200 {object} apis.Response{code=int,data=[]apis.ApplicationMeta} @Failure 500 {object} apis.Response{code=int,data=string} @Router /envs/{envName}/apps [get]
func (*APIServer) ListCapabilities ¶ added in v0.1.1
func (s *APIServer) ListCapabilities(c *gin.Context)
ListCapabilities lists capabilities of a capability center
func (*APIServer) ListCapabilityCenters ¶ added in v0.1.1
func (s *APIServer) ListCapabilityCenters(c *gin.Context)
ListCapabilityCenters list all added capability centers
func (*APIServer) ListEnv ¶ added in v0.1.1
func (s *APIServer) ListEnv(c *gin.Context)
ListEnv lists all environments @Tags environments @ID listEnvironments @Accept json @Produce json @success 200 {object} apis.Response{code=int,data=[]apis.Environment} @Failure 500 {object} apis.Response{code=int,data=string} @Router /envs/ [get]
func (*APIServer) ListScope ¶ added in v0.1.1
func (s *APIServer) ListScope(c *gin.Context)
ListScope lists all scopes
func (*APIServer) ListTrait ¶ added in v0.1.1
func (s *APIServer) ListTrait(c *gin.Context)
ListTrait lists all traits
func (*APIServer) ListWorkload ¶ added in v0.1.1
func (s *APIServer) ListWorkload(c *gin.Context)
ListWorkload lists all workloads in the cluster
func (*APIServer) RemoveCapabilityFromCluster ¶ added in v0.1.1
func (s *APIServer) RemoveCapabilityFromCluster(c *gin.Context)
RemoveCapabilityFromCluster remove a specific capability from cluster
func (*APIServer) SetEnv ¶ added in v0.1.1
func (s *APIServer) SetEnv(c *gin.Context)
SetEnv sets an environment @Tags environments @ID setEnvironment @Param envName path string true "envName" @Success 200 {object} apis.Response{code=int,data=string} @Failure 500 {object} apis.Response{code=int,data=string} @Router /envs/{envName} [patch]
func (*APIServer) Shutdown ¶
func (s *APIServer) Shutdown(ctx context.Context) error
Shutdown will close the apiserver
func (*APIServer) SwaggerJSON ¶ added in v0.2.2
func (s *APIServer) SwaggerJSON(c *gin.Context)
SwaggerJSON use /swagger.json and /doc.json 404
func (*APIServer) SyncCapabilityCenter ¶ added in v0.1.1
func (s *APIServer) SyncCapabilityCenter(c *gin.Context)
SyncCapabilityCenter synchronizes capability center from remote
func (*APIServer) UpdateApps ¶ added in v0.1.1
func (s *APIServer) UpdateApps(c *gin.Context)
UpdateApps is placeholder for updating applications
func (*APIServer) UpdateEnv ¶ added in v0.1.1
func (s *APIServer) UpdateEnv(c *gin.Context)
UpdateEnv updates an environment @Tags environments @ID updateEnvironment @Param envName path string true "envName" @Param body body apis.EnvironmentBody true "envName" @Success 200 {object} apis.Response{code=int,data=string} @Failure 500 {object} apis.Response{code=int,data=string} @Router /envs/{envName} [put]
func (*APIServer) UpdateScope ¶ added in v0.1.1
func (s *APIServer) UpdateScope(c *gin.Context)
UpdateScope updates a scope
func (*APIServer) UpdateWorkload ¶ added in v0.1.1
func (s *APIServer) UpdateWorkload(c *gin.Context)
UpdateWorkload updates a workload