Documentation ¶
Overview ¶
Application contains the API handlers to manage applications. Except for app environment.
Index ¶
- Constants
- func CheckOriginFunc(allowedOrigins []string) func(r *http.Request) bool
- func GetFileContentType(file multipart.File) (string, error)
- type Controller
- func (hc Controller) Create(c *gin.Context) apierror.APIErrors
- func (hc Controller) Delete(c *gin.Context) apierror.APIErrors
- func (hc Controller) Deploy(c *gin.Context) apierror.APIErrors
- func (hc Controller) Exec(c *gin.Context) apierror.APIErrors
- func (hc Controller) FullIndex(c *gin.Context) apierror.APIErrors
- func (hc Controller) GetPart(c *gin.Context) apierror.APIErrors
- func (hc Controller) ImportGit(c *gin.Context) apierror.APIErrors
- func (hc Controller) Index(c *gin.Context) apierror.APIErrors
- func (hc Controller) Logs(c *gin.Context)
- func (oc Controller) Match(c *gin.Context) apierror.APIErrors
- func (hc Controller) PortForward(c *gin.Context) apierror.APIErrors
- func (hc Controller) Restart(c *gin.Context) apierror.APIErrors
- func (hc Controller) Running(c *gin.Context) apierror.APIErrors
- func (hc Controller) Show(c *gin.Context) apierror.APIErrors
- func (hc Controller) Stage(c *gin.Context) apierror.APIErrors
- func (hc Controller) Staged(c *gin.Context) apierror.APIErrors
- func (hc Controller) Update(c *gin.Context) apierror.APIErrors
- func (hc Controller) Upload(c *gin.Context) apierror.APIErrors
- func (hc Controller) ValidateChartValues(c *gin.Context) apierror.APIErrors
Constants ¶
const ( DefaultInstances = int32(1) LocalRegistry = "127.0.0.1:30500/apps" )
Variables ¶
This section is empty.
Functions ¶
func CheckOriginFunc ¶ added in v0.5.1
Types ¶
type Controller ¶
type Controller struct { }
Controller represents all functionality of the API related to applications
func (Controller) Create ¶
func (hc Controller) Create(c *gin.Context) apierror.APIErrors
Create handles the API endpoint POST /namespaces/:namespace/applications It creates a new and empty application. I.e. without a workload.
func (Controller) Delete ¶
func (hc Controller) Delete(c *gin.Context) apierror.APIErrors
Delete handles the API endpoint DELETE /namespaces/:namespace/applications/:app It removes the named application
func (Controller) Deploy ¶
func (hc Controller) Deploy(c *gin.Context) apierror.APIErrors
Deploy handles the API endpoint /namespaces/:namespace/applications/:app/deploy It uses an application chart to create the deployment, configuration and ingress (kube) resources for the app.
func (Controller) Exec ¶ added in v0.3.6
func (hc Controller) Exec(c *gin.Context) apierror.APIErrors
func (Controller) FullIndex ¶
func (hc Controller) FullIndex(c *gin.Context) apierror.APIErrors
FullIndex handles the API endpoint GET /applications It lists all the known applications in all namespaces, with and without workload.
func (Controller) GetPart ¶ added in v0.6.3
func (hc Controller) GetPart(c *gin.Context) apierror.APIErrors
GetPart handles the API endpoint GET /namespaces/:namespace/applications/:app/part/:part It determines the contents of the requested part (values, chart, image) and returns as the response of the handler.
func (Controller) ImportGit ¶
func (hc Controller) ImportGit(c *gin.Context) apierror.APIErrors
ImportGit handles the API endpoint /namespaces/:namespace/applications/:app/import-git. It receives a Git repo url and revision, clones that (shallow clone), creates a tarball of the repo and puts it on S3.
func (Controller) Index ¶
func (hc Controller) Index(c *gin.Context) apierror.APIErrors
Index handles the API endpoint GET /namespaces/:namespace/applications It lists all the known applications in the specified namespace, with and without workload.
func (Controller) Logs ¶
func (hc Controller) Logs(c *gin.Context)
Logs handles the API endpoints GET /namespaces/:namespace/applications/:app/logs and GET /namespaces/:namespace/staging/:stage_id/logs It arranges for the logs of the specified application to be streamed over a websocket. Dependent on the endpoint this may be either regular logs, or the app's staging logs.
func (Controller) Match ¶ added in v0.9.0
func (oc Controller) Match(c *gin.Context) apierror.APIErrors
Match handles the API endpoint /namespace/:namespace/appsmatches/:pattern (GET) It returns a list of all Epinio-controlled applications matching the prefix pattern.
func (Controller) PortForward ¶ added in v0.4.0
func (hc Controller) PortForward(c *gin.Context) apierror.APIErrors
func (Controller) Restart ¶ added in v0.3.3
func (hc Controller) Restart(c *gin.Context) apierror.APIErrors
Restart handles the API endpoint POST /namespaces/:namespace/applications/:app/restart
func (Controller) Running ¶
func (hc Controller) Running(c *gin.Context) apierror.APIErrors
Running handles the API endpoint GET /namespaces/:namespace/applications/:app/running
It waits for the specified application to be running (i.e. its deployment to be complete), before it returns. An exception is if the application does not become ready within `duration.ToAppBuilt()` (default: 3 minutes). In that case it returns with an error after that time.
__API PORTABILITY NOTE__
With the switch to deployment of apps via helm, and waiting for the helm deployment to be ready before returning this endpoint is technically superfluous, and it should never fail. The command line has been modified to not invoke it anymore.
It is kept for older clients still calling on it. Because of that it is also kept functional. Instead of checking for an app `Deployment` and its status it now checks the app `Pod` stati.
func (Controller) Show ¶
func (hc Controller) Show(c *gin.Context) apierror.APIErrors
Show handles the API endpoint GET /namespaces/:namespace/applications/:app It returns the details of the specified application.
func (Controller) Stage ¶
func (hc Controller) Stage(c *gin.Context) apierror.APIErrors
Stage handles the API endpoint /namespaces/:namespace/applications/:app/stage It creates a Job resource to stage the app
func (Controller) Staged ¶
func (hc Controller) Staged(c *gin.Context) apierror.APIErrors
Staged handles the API endpoint /namespaces/:namespace/staging/:stage_id/complete It waits for the Job resource staging the app to complete
func (Controller) Update ¶
func (hc Controller) Update(c *gin.Context) apierror.APIErrors
Update handles the API endpoint PATCH /namespaces/:namespace/applications/:app
func (Controller) Upload ¶
func (hc Controller) Upload(c *gin.Context) apierror.APIErrors
Upload handles the API endpoint /namespaces/:namespace/applications/:app/store. It receives the application data as a tarball and stores it. Then it creates the k8s resources needed for staging
func (Controller) ValidateChartValues ¶ added in v1.2.0
func (hc Controller) ValidateChartValues(c *gin.Context) apierror.APIErrors
ValidateChartValues handles the API endpoint /namespaces/:namespace/applications/:app/validate-cv Given application by name, and namespace the custom chart values are checked against the declarations in the referenced appchart.