Check for equal FFmpeg skills, remove /v1/version

This commit is contained in:
Ingo Oppermann
2023-07-06 16:12:06 +02:00
parent 6c2e8b0ec3
commit 9905ac70f0
23 changed files with 1856 additions and 186 deletions

View File

@@ -96,7 +96,7 @@ func NewAPI(config APIConfig) (API, error) {
doc.GET("", echoSwagger.EchoWrapHandler(echoSwagger.InstanceName("ClusterAPI")))
a.router.GET("/", a.Version)
a.router.GET("/v1/about", a.Version)
a.router.GET("/v1/about", a.About)
a.router.GET("/v1/barrier/:name", a.Barrier)
@@ -125,6 +125,7 @@ func NewAPI(config APIConfig) (API, error) {
a.router.GET("/v1/core", a.CoreAPIAddress)
a.router.GET("/v1/core/config", a.CoreConfig)
a.router.GET("/v1/core/skills", a.CoreSkills)
return a, nil
}
@@ -147,11 +148,29 @@ func (a *api) Shutdown(ctx context.Context) error {
// @Produce json
// @Success 200 {string} string
// @Success 500 {object} Error
// @Router /v1/version [get]
// @Router / [get]
func (a *api) Version(c echo.Context) error {
return c.JSON(http.StatusOK, Version.String())
}
// About returns info about the cluster
// @Summary Cluster info
// @Description Cluster info
// @Tags v1.0.0
// @ID cluster-1-about
// @Produce json
// @Success 200 {string} string
// @Success 500 {object} Error
// @Router /v1/about [get]
func (a *api) About(c echo.Context) error {
about, err := a.cluster.About()
if err != nil {
return Err(http.StatusInternalServerError, "", "%s", err.Error())
}
return c.JSON(http.StatusOK, about)
}
// Barrier returns if the barrier already has been passed
// @Summary Has the barrier already has been passed
// @Description Has the barrier already has been passed
@@ -651,6 +670,19 @@ func (a *api) CoreConfig(c echo.Context) error {
return c.JSON(http.StatusOK, config)
}
// CoreSkills returns the Core skills of this node
// @Summary Core skills
// @Description Core skills of this node
// @Tags v1.0.0
// @ID cluster-1-core-skills
// @Produce json
// @Success 200 {object} skills.Skills
// @Router /v1/core/skills [get]
func (a *api) CoreSkills(c echo.Context) error {
skills := a.cluster.CoreSkills()
return c.JSON(http.StatusOK, skills)
}
// Lock tries to acquire a named lock
// @Summary Acquire a named lock
// @Description Acquire a named lock