apiserver

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

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

func New(c common.Args, port, staticPath string) (*APIServer, error)

New will create APIServer

func (*APIServer) AddCapabilityCenter

func (s *APIServer) AddCapabilityCenter(c *gin.Context)

AddCapabilityCenter adds and synchronizes a capability center from remote

func (*APIServer) AddCapabilityIntoCluster

func (s *APIServer) AddCapabilityIntoCluster(c *gin.Context)

AddCapabilityIntoCluster adds specific capability into cluster

func (*APIServer) AttachTrait

func (s *APIServer) AttachTrait(c *gin.Context)

AttachTrait attaches a trait to a component

func (*APIServer) CreateApplication

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

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

func (s *APIServer) CreateScope(c *gin.Context)

CreateScope creates a scope

func (*APIServer) DeleteApps

func (s *APIServer) DeleteApps(c *gin.Context)

DeleteApps deletes an application by the namespaced name in the gin.Context

func (*APIServer) DeleteCapabilityCenter

func (s *APIServer) DeleteCapabilityCenter(c *gin.Context)

DeleteCapabilityCenter deltes a capability cernter already added

func (*APIServer) DeleteComponent

func (s *APIServer) DeleteComponent(c *gin.Context)

DeleteComponent deletes a component from cluster

func (*APIServer) DeleteEnv

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

func (s *APIServer) DeleteScope(c *gin.Context)

DeleteScope deletes a scope

func (*APIServer) DetachTrait

func (s *APIServer) DetachTrait(c *gin.Context)

DetachTrait detaches a trait from a component

func (*APIServer) GetApp

func (s *APIServer) GetApp(c *gin.Context)

GetApp requests an application by the namespaced name in the gin.Context

func (*APIServer) GetComponent

func (s *APIServer) GetComponent(c *gin.Context)

GetComponent gets a comoponent from cluster

func (*APIServer) GetDefinition

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

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

func (s *APIServer) GetScope(c *gin.Context)

GetScope gets a scope

func (*APIServer) GetTrait

func (s *APIServer) GetTrait(c *gin.Context)

GetTrait gets a trait by name

func (*APIServer) GetVersion

func (s *APIServer) GetVersion(c *gin.Context)

GetVersion will return version for dashboard

func (*APIServer) GetWorkload

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

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

func (s *APIServer) ListCapabilities(c *gin.Context)

ListCapabilities lists capabilities of a capability center

func (*APIServer) ListCapabilityCenters

func (s *APIServer) ListCapabilityCenters(c *gin.Context)

ListCapabilityCenters list all added capability centers

func (*APIServer) ListEnv

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

func (s *APIServer) ListScope(c *gin.Context)

ListScope lists all scopes

func (*APIServer) ListTrait

func (s *APIServer) ListTrait(c *gin.Context)

ListTrait lists all traits

func (*APIServer) ListWorkload

func (s *APIServer) ListWorkload(c *gin.Context)

ListWorkload lists all workloads in the cluster

func (*APIServer) RemoveCapabilityFromCluster

func (s *APIServer) RemoveCapabilityFromCluster(c *gin.Context)

RemoveCapabilityFromCluster remove a specific capability from cluster

func (*APIServer) SetEnv

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

func (s *APIServer) SwaggerJSON(c *gin.Context)

SwaggerJSON use /swagger.json and /doc.json 404

func (*APIServer) SyncCapabilityCenter

func (s *APIServer) SyncCapabilityCenter(c *gin.Context)

SyncCapabilityCenter synchronizes capability center from remote

func (*APIServer) UpdateApps

func (s *APIServer) UpdateApps(c *gin.Context)

UpdateApps is placeholder for updating applications

func (*APIServer) UpdateEnv

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

func (s *APIServer) UpdateScope(c *gin.Context)

UpdateScope updates a scope

func (*APIServer) UpdateWorkload

func (s *APIServer) UpdateWorkload(c *gin.Context)

UpdateWorkload updates a workload

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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