Sybren A. Stüvel 744fabea78 OAPI: rename pkg/api/flamenco-manager.yaml to flamenco-openapi.yaml
Rename `pkg/api/flamenco-manager.yaml` to `flamenco-openapi.yaml`, to
distinguish the OpenAPI definition file from the Flamenco Manager
configuration file of the same name (but in a different directory).

No functional changes.
2022-05-19 15:22:37 +02:00

27 lines
685 B
Go

// Package api_impl implements the OpenAPI API from pkg/api/flamenco-openapi.yaml.
package api_impl
// SPDX-License-Identifier: GPL-3.0-or-later
import (
"net/http"
"git.blender.org/flamenco/internal/appinfo"
"git.blender.org/flamenco/pkg/api"
"github.com/labstack/echo/v4"
)
func (f *Flamenco) GetVersion(e echo.Context) error {
return e.JSON(http.StatusOK, api.FlamencoVersion{
Version: appinfo.ApplicationVersion,
Name: appinfo.ApplicationName,
})
}
func (f *Flamenco) GetConfiguration(e echo.Context) error {
return e.JSON(http.StatusOK, api.ManagerConfiguration{
ShamanEnabled: f.isShamanEnabled(),
StorageLocation: f.config.EffectiveStoragePath(),
})
}