mirror of
https://github.com/datarhei/core.git
synced 2025-10-04 15:42:57 +08:00
Check for equal FFmpeg skills, remove /v1/version
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user