Flamenco/pkg/api/openapi_server.gen.go

1062 lines
42 KiB
Go
Generated

// Package api provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen version v1.9.0 DO NOT EDIT.
package api
import (
"fmt"
"net/http"
"github.com/deepmap/oapi-codegen/pkg/runtime"
"github.com/labstack/echo/v4"
)
// ServerInterface represents all server handlers.
type ServerInterface interface {
// Get the configuration of this Manager.
// (GET /api/v3/configuration)
GetConfiguration(ctx echo.Context) error
// Find one or more CLI commands for use as way to start Blender
// (GET /api/v3/configuration/check/blender)
FindBlenderExePath(ctx echo.Context) error
// Validate a CLI command for use as way to start Blender
// (POST /api/v3/configuration/check/blender)
CheckBlenderExePath(ctx echo.Context) error
// Validate a path for use as shared storage.
// (POST /api/v3/configuration/check/shared-storage)
CheckSharedStoragePath(ctx echo.Context) error
// Retrieve the configuration of Flamenco Manager.
// (GET /api/v3/configuration/file)
GetConfigurationFile(ctx echo.Context) error
// Update the Manager's configuration, and restart it in fully functional mode.
// (POST /api/v3/configuration/setup-assistant)
SaveSetupAssistantConfig(ctx echo.Context) error
// Get the shared storage location of this Manager, adjusted for the given audience and platform.
// (GET /api/v3/configuration/shared-storage/{audience}/{platform})
GetSharedStorage(ctx echo.Context, audience ManagerVariableAudience, platform string) error
// Get the variables of this Manager. Used by the Blender add-on to recognise two-way variables, and for the web interface to do variable replacement based on the browser's platform.
// (GET /api/v3/configuration/variables/{audience}/{platform})
GetVariables(ctx echo.Context, audience ManagerVariableAudience, platform string) error
// Submit a new job for Flamenco Manager to execute.
// (POST /api/v3/jobs)
SubmitJob(ctx echo.Context) error
// Submit a new job for Flamenco Manager to check.
// (POST /api/v3/jobs/check)
SubmitJobCheck(ctx echo.Context) error
// Get the URL that serves the last-rendered images.
// (GET /api/v3/jobs/last-rendered)
FetchGlobalLastRenderedInfo(ctx echo.Context) error
// Mark jobs for deletion, based on certain criteria.
// (DELETE /api/v3/jobs/mass-delete)
DeleteJobMass(ctx echo.Context) error
// Fetch list of jobs.
// (POST /api/v3/jobs/query)
QueryJobs(ctx echo.Context) error
// Get single job type and its parameters.
// (GET /api/v3/jobs/type/{typeName})
GetJobType(ctx echo.Context, typeName string) error
// Get list of job types and their parameters.
// (GET /api/v3/jobs/types)
GetJobTypes(ctx echo.Context) error
// Request deletion this job, including its tasks and any log files. The actual deletion may happen in the background. No job files will be deleted (yet).
// (DELETE /api/v3/jobs/{job_id})
DeleteJob(ctx echo.Context, jobId string) error
// Fetch info about the job.
// (GET /api/v3/jobs/{job_id})
FetchJob(ctx echo.Context, jobId string) error
// Remove entries from a job blocklist.
// (DELETE /api/v3/jobs/{job_id}/blocklist)
RemoveJobBlocklist(ctx echo.Context, jobId string) error
// Fetch the list of workers that are blocked from doing certain task types on this job.
// (GET /api/v3/jobs/{job_id}/blocklist)
FetchJobBlocklist(ctx echo.Context, jobId string) error
// Get the URL that serves the last-rendered images of this job.
// (GET /api/v3/jobs/{job_id}/last-rendered)
FetchJobLastRenderedInfo(ctx echo.Context, jobId string) error
// (POST /api/v3/jobs/{job_id}/setpriority)
SetJobPriority(ctx echo.Context, jobId string) error
// (POST /api/v3/jobs/{job_id}/setstatus)
SetJobStatus(ctx echo.Context, jobId string) error
// Fetch a summary of all tasks of the given job.
// (GET /api/v3/jobs/{job_id}/tasks)
FetchJobTasks(ctx echo.Context, jobId string) error
// Get info about what would be deleted when deleting this job. The job itself, its logs, and the last-rendered images will always be deleted. The job files are only deleted conditionally, and this operation can be used to figure that out.
// (GET /api/v3/jobs/{job_id}/what-would-delete-do)
DeleteJobWhatWouldItDo(ctx echo.Context, jobId string) error
// Create a directory, and symlink the required files into it. The files must all have been uploaded to Shaman before calling this endpoint.
// (POST /api/v3/shaman/checkout/create)
ShamanCheckout(ctx echo.Context) error
// Checks a Shaman Requirements file, and reports which files are unknown.
// (POST /api/v3/shaman/checkout/requirements)
ShamanCheckoutRequirements(ctx echo.Context) error
// Check the status of a file on the Shaman server.
// (GET /api/v3/shaman/files/{checksum}/{filesize})
ShamanFileStoreCheck(ctx echo.Context, checksum string, filesize int) error
// Store a new file on the Shaman server. Note that the Shaman server can forcibly close the HTTP connection when another client finishes uploading the exact same file, to prevent double uploads.
// The file's contents should be sent in the request body.
// (POST /api/v3/shaman/files/{checksum}/{filesize})
ShamanFileStore(ctx echo.Context, checksum string, filesize int, params ShamanFileStoreParams) error
// Get the status of this Flamenco farm.
// (GET /api/v3/status)
GetFarmStatus(ctx echo.Context) error
// Fetch a single task.
// (GET /api/v3/tasks/{task_id})
FetchTask(ctx echo.Context, taskId string) error
// Get the URL of the task log, and some more info.
// (GET /api/v3/tasks/{task_id}/log)
FetchTaskLogInfo(ctx echo.Context, taskId string) error
// Fetch the last few lines of the task's log.
// (GET /api/v3/tasks/{task_id}/logtail)
FetchTaskLogTail(ctx echo.Context, taskId string) error
// (POST /api/v3/tasks/{task_id}/setstatus)
SetTaskStatus(ctx echo.Context, taskId string) error
// Get the Flamenco version of this Manager
// (GET /api/v3/version)
GetVersion(ctx echo.Context) error
// Remove this worker tag. This unassigns all workers from the tag and removes it.
// (DELETE /api/v3/worker-mgt/tag/{tag_id})
DeleteWorkerTag(ctx echo.Context, tagId string) error
// Get a single worker tag.
// (GET /api/v3/worker-mgt/tag/{tag_id})
FetchWorkerTag(ctx echo.Context, tagId string) error
// Update an existing worker tag.
// (PUT /api/v3/worker-mgt/tag/{tag_id})
UpdateWorkerTag(ctx echo.Context, tagId string) error
// Get list of worker tags.
// (GET /api/v3/worker-mgt/tags)
FetchWorkerTags(ctx echo.Context) error
// Create a new worker tag.
// (POST /api/v3/worker-mgt/tags)
CreateWorkerTag(ctx echo.Context) error
// Get list of workers.
// (GET /api/v3/worker-mgt/workers)
FetchWorkers(ctx echo.Context) error
// Remove the given worker. It is recommended to only call this function when the worker is in `offline` state. If the worker is still running, stop it first. Any task still assigned to the worker will be requeued.
// (DELETE /api/v3/worker-mgt/workers/{worker_id})
DeleteWorker(ctx echo.Context, workerId string) error
// Fetch info about the worker.
// (GET /api/v3/worker-mgt/workers/{worker_id})
FetchWorker(ctx echo.Context, workerId string) error
// (POST /api/v3/worker-mgt/workers/{worker_id}/setstatus)
RequestWorkerStatusChange(ctx echo.Context, workerId string) error
// (POST /api/v3/worker-mgt/workers/{worker_id}/settags)
SetWorkerTags(ctx echo.Context, workerId string) error
// (GET /api/v3/worker-mgt/workers/{worker_id}/sleep-schedule)
FetchWorkerSleepSchedule(ctx echo.Context, workerId string) error
// (POST /api/v3/worker-mgt/workers/{worker_id}/sleep-schedule)
SetWorkerSleepSchedule(ctx echo.Context, workerId string) error
// Register a new worker
// (POST /api/v3/worker/register-worker)
RegisterWorker(ctx echo.Context) error
// Mark the worker as offline
// (POST /api/v3/worker/sign-off)
SignOff(ctx echo.Context) error
// Authenticate & sign in the worker.
// (POST /api/v3/worker/sign-on)
SignOn(ctx echo.Context) error
// (GET /api/v3/worker/state)
WorkerState(ctx echo.Context) error
// Worker changed state. This could be as acknowledgement of a Manager-requested state change, or in response to worker-local signals.
// (POST /api/v3/worker/state-changed)
WorkerStateChanged(ctx echo.Context) error
// Obtain a new task to execute
// (POST /api/v3/worker/task)
ScheduleTask(ctx echo.Context) error
// Update the task, typically to indicate progress, completion, or failure.
// (POST /api/v3/worker/task/{task_id})
TaskUpdate(ctx echo.Context, taskId string) error
// The response indicates whether the worker is allowed to run / keep running the task. Optionally contains a queued worker status change.
// (GET /api/v3/worker/task/{task_id}/may-i-run)
MayWorkerRun(ctx echo.Context, taskId string) error
// Store the most recently rendered frame here. Note that it is up to the Worker to ensure this is in a format that's digestable by the Manager. Currently only PNG and JPEG support is planned.
// (POST /api/v3/worker/task/{task_id}/output-produced)
TaskOutputProduced(ctx echo.Context, taskId string) error
}
// ServerInterfaceWrapper converts echo contexts to parameters.
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
// GetConfiguration converts echo context to params.
func (w *ServerInterfaceWrapper) GetConfiguration(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetConfiguration(ctx)
return err
}
// FindBlenderExePath converts echo context to params.
func (w *ServerInterfaceWrapper) FindBlenderExePath(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.FindBlenderExePath(ctx)
return err
}
// CheckBlenderExePath converts echo context to params.
func (w *ServerInterfaceWrapper) CheckBlenderExePath(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.CheckBlenderExePath(ctx)
return err
}
// CheckSharedStoragePath converts echo context to params.
func (w *ServerInterfaceWrapper) CheckSharedStoragePath(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.CheckSharedStoragePath(ctx)
return err
}
// GetConfigurationFile converts echo context to params.
func (w *ServerInterfaceWrapper) GetConfigurationFile(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetConfigurationFile(ctx)
return err
}
// SaveSetupAssistantConfig converts echo context to params.
func (w *ServerInterfaceWrapper) SaveSetupAssistantConfig(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.SaveSetupAssistantConfig(ctx)
return err
}
// GetSharedStorage converts echo context to params.
func (w *ServerInterfaceWrapper) GetSharedStorage(ctx echo.Context) error {
var err error
// ------------- Path parameter "audience" -------------
var audience ManagerVariableAudience
err = runtime.BindStyledParameterWithLocation("simple", false, "audience", runtime.ParamLocationPath, ctx.Param("audience"), &audience)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter audience: %s", err))
}
// ------------- Path parameter "platform" -------------
var platform string
err = runtime.BindStyledParameterWithLocation("simple", false, "platform", runtime.ParamLocationPath, ctx.Param("platform"), &platform)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter platform: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetSharedStorage(ctx, audience, platform)
return err
}
// GetVariables converts echo context to params.
func (w *ServerInterfaceWrapper) GetVariables(ctx echo.Context) error {
var err error
// ------------- Path parameter "audience" -------------
var audience ManagerVariableAudience
err = runtime.BindStyledParameterWithLocation("simple", false, "audience", runtime.ParamLocationPath, ctx.Param("audience"), &audience)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter audience: %s", err))
}
// ------------- Path parameter "platform" -------------
var platform string
err = runtime.BindStyledParameterWithLocation("simple", false, "platform", runtime.ParamLocationPath, ctx.Param("platform"), &platform)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter platform: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetVariables(ctx, audience, platform)
return err
}
// SubmitJob converts echo context to params.
func (w *ServerInterfaceWrapper) SubmitJob(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.SubmitJob(ctx)
return err
}
// SubmitJobCheck converts echo context to params.
func (w *ServerInterfaceWrapper) SubmitJobCheck(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.SubmitJobCheck(ctx)
return err
}
// FetchGlobalLastRenderedInfo converts echo context to params.
func (w *ServerInterfaceWrapper) FetchGlobalLastRenderedInfo(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.FetchGlobalLastRenderedInfo(ctx)
return err
}
// DeleteJobMass converts echo context to params.
func (w *ServerInterfaceWrapper) DeleteJobMass(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.DeleteJobMass(ctx)
return err
}
// QueryJobs converts echo context to params.
func (w *ServerInterfaceWrapper) QueryJobs(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.QueryJobs(ctx)
return err
}
// GetJobType converts echo context to params.
func (w *ServerInterfaceWrapper) GetJobType(ctx echo.Context) error {
var err error
// ------------- Path parameter "typeName" -------------
var typeName string
err = runtime.BindStyledParameterWithLocation("simple", false, "typeName", runtime.ParamLocationPath, ctx.Param("typeName"), &typeName)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter typeName: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetJobType(ctx, typeName)
return err
}
// GetJobTypes converts echo context to params.
func (w *ServerInterfaceWrapper) GetJobTypes(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetJobTypes(ctx)
return err
}
// DeleteJob converts echo context to params.
func (w *ServerInterfaceWrapper) DeleteJob(ctx echo.Context) error {
var err error
// ------------- Path parameter "job_id" -------------
var jobId string
err = runtime.BindStyledParameterWithLocation("simple", false, "job_id", runtime.ParamLocationPath, ctx.Param("job_id"), &jobId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter job_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.DeleteJob(ctx, jobId)
return err
}
// FetchJob converts echo context to params.
func (w *ServerInterfaceWrapper) FetchJob(ctx echo.Context) error {
var err error
// ------------- Path parameter "job_id" -------------
var jobId string
err = runtime.BindStyledParameterWithLocation("simple", false, "job_id", runtime.ParamLocationPath, ctx.Param("job_id"), &jobId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter job_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.FetchJob(ctx, jobId)
return err
}
// RemoveJobBlocklist converts echo context to params.
func (w *ServerInterfaceWrapper) RemoveJobBlocklist(ctx echo.Context) error {
var err error
// ------------- Path parameter "job_id" -------------
var jobId string
err = runtime.BindStyledParameterWithLocation("simple", false, "job_id", runtime.ParamLocationPath, ctx.Param("job_id"), &jobId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter job_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.RemoveJobBlocklist(ctx, jobId)
return err
}
// FetchJobBlocklist converts echo context to params.
func (w *ServerInterfaceWrapper) FetchJobBlocklist(ctx echo.Context) error {
var err error
// ------------- Path parameter "job_id" -------------
var jobId string
err = runtime.BindStyledParameterWithLocation("simple", false, "job_id", runtime.ParamLocationPath, ctx.Param("job_id"), &jobId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter job_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.FetchJobBlocklist(ctx, jobId)
return err
}
// FetchJobLastRenderedInfo converts echo context to params.
func (w *ServerInterfaceWrapper) FetchJobLastRenderedInfo(ctx echo.Context) error {
var err error
// ------------- Path parameter "job_id" -------------
var jobId string
err = runtime.BindStyledParameterWithLocation("simple", false, "job_id", runtime.ParamLocationPath, ctx.Param("job_id"), &jobId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter job_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.FetchJobLastRenderedInfo(ctx, jobId)
return err
}
// SetJobPriority converts echo context to params.
func (w *ServerInterfaceWrapper) SetJobPriority(ctx echo.Context) error {
var err error
// ------------- Path parameter "job_id" -------------
var jobId string
err = runtime.BindStyledParameterWithLocation("simple", false, "job_id", runtime.ParamLocationPath, ctx.Param("job_id"), &jobId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter job_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.SetJobPriority(ctx, jobId)
return err
}
// SetJobStatus converts echo context to params.
func (w *ServerInterfaceWrapper) SetJobStatus(ctx echo.Context) error {
var err error
// ------------- Path parameter "job_id" -------------
var jobId string
err = runtime.BindStyledParameterWithLocation("simple", false, "job_id", runtime.ParamLocationPath, ctx.Param("job_id"), &jobId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter job_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.SetJobStatus(ctx, jobId)
return err
}
// FetchJobTasks converts echo context to params.
func (w *ServerInterfaceWrapper) FetchJobTasks(ctx echo.Context) error {
var err error
// ------------- Path parameter "job_id" -------------
var jobId string
err = runtime.BindStyledParameterWithLocation("simple", false, "job_id", runtime.ParamLocationPath, ctx.Param("job_id"), &jobId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter job_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.FetchJobTasks(ctx, jobId)
return err
}
// DeleteJobWhatWouldItDo converts echo context to params.
func (w *ServerInterfaceWrapper) DeleteJobWhatWouldItDo(ctx echo.Context) error {
var err error
// ------------- Path parameter "job_id" -------------
var jobId string
err = runtime.BindStyledParameterWithLocation("simple", false, "job_id", runtime.ParamLocationPath, ctx.Param("job_id"), &jobId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter job_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.DeleteJobWhatWouldItDo(ctx, jobId)
return err
}
// ShamanCheckout converts echo context to params.
func (w *ServerInterfaceWrapper) ShamanCheckout(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.ShamanCheckout(ctx)
return err
}
// ShamanCheckoutRequirements converts echo context to params.
func (w *ServerInterfaceWrapper) ShamanCheckoutRequirements(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.ShamanCheckoutRequirements(ctx)
return err
}
// ShamanFileStoreCheck converts echo context to params.
func (w *ServerInterfaceWrapper) ShamanFileStoreCheck(ctx echo.Context) error {
var err error
// ------------- Path parameter "checksum" -------------
var checksum string
err = runtime.BindStyledParameterWithLocation("simple", false, "checksum", runtime.ParamLocationPath, ctx.Param("checksum"), &checksum)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter checksum: %s", err))
}
// ------------- Path parameter "filesize" -------------
var filesize int
err = runtime.BindStyledParameterWithLocation("simple", false, "filesize", runtime.ParamLocationPath, ctx.Param("filesize"), &filesize)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filesize: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.ShamanFileStoreCheck(ctx, checksum, filesize)
return err
}
// ShamanFileStore converts echo context to params.
func (w *ServerInterfaceWrapper) ShamanFileStore(ctx echo.Context) error {
var err error
// ------------- Path parameter "checksum" -------------
var checksum string
err = runtime.BindStyledParameterWithLocation("simple", false, "checksum", runtime.ParamLocationPath, ctx.Param("checksum"), &checksum)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter checksum: %s", err))
}
// ------------- Path parameter "filesize" -------------
var filesize int
err = runtime.BindStyledParameterWithLocation("simple", false, "filesize", runtime.ParamLocationPath, ctx.Param("filesize"), &filesize)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filesize: %s", err))
}
// Parameter object where we will unmarshal all parameters from the context
var params ShamanFileStoreParams
headers := ctx.Request().Header
// ------------- Optional header parameter "X-Shaman-Can-Defer-Upload" -------------
if valueList, found := headers[http.CanonicalHeaderKey("X-Shaman-Can-Defer-Upload")]; found {
var XShamanCanDeferUpload bool
n := len(valueList)
if n != 1 {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Expected one value for X-Shaman-Can-Defer-Upload, got %d", n))
}
err = runtime.BindStyledParameterWithLocation("simple", false, "X-Shaman-Can-Defer-Upload", runtime.ParamLocationHeader, valueList[0], &XShamanCanDeferUpload)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter X-Shaman-Can-Defer-Upload: %s", err))
}
params.XShamanCanDeferUpload = &XShamanCanDeferUpload
}
// ------------- Optional header parameter "X-Shaman-Original-Filename" -------------
if valueList, found := headers[http.CanonicalHeaderKey("X-Shaman-Original-Filename")]; found {
var XShamanOriginalFilename string
n := len(valueList)
if n != 1 {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Expected one value for X-Shaman-Original-Filename, got %d", n))
}
err = runtime.BindStyledParameterWithLocation("simple", false, "X-Shaman-Original-Filename", runtime.ParamLocationHeader, valueList[0], &XShamanOriginalFilename)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter X-Shaman-Original-Filename: %s", err))
}
params.XShamanOriginalFilename = &XShamanOriginalFilename
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.ShamanFileStore(ctx, checksum, filesize, params)
return err
}
// GetFarmStatus converts echo context to params.
func (w *ServerInterfaceWrapper) GetFarmStatus(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetFarmStatus(ctx)
return err
}
// FetchTask converts echo context to params.
func (w *ServerInterfaceWrapper) FetchTask(ctx echo.Context) error {
var err error
// ------------- Path parameter "task_id" -------------
var taskId string
err = runtime.BindStyledParameterWithLocation("simple", false, "task_id", runtime.ParamLocationPath, ctx.Param("task_id"), &taskId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter task_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.FetchTask(ctx, taskId)
return err
}
// FetchTaskLogInfo converts echo context to params.
func (w *ServerInterfaceWrapper) FetchTaskLogInfo(ctx echo.Context) error {
var err error
// ------------- Path parameter "task_id" -------------
var taskId string
err = runtime.BindStyledParameterWithLocation("simple", false, "task_id", runtime.ParamLocationPath, ctx.Param("task_id"), &taskId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter task_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.FetchTaskLogInfo(ctx, taskId)
return err
}
// FetchTaskLogTail converts echo context to params.
func (w *ServerInterfaceWrapper) FetchTaskLogTail(ctx echo.Context) error {
var err error
// ------------- Path parameter "task_id" -------------
var taskId string
err = runtime.BindStyledParameterWithLocation("simple", false, "task_id", runtime.ParamLocationPath, ctx.Param("task_id"), &taskId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter task_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.FetchTaskLogTail(ctx, taskId)
return err
}
// SetTaskStatus converts echo context to params.
func (w *ServerInterfaceWrapper) SetTaskStatus(ctx echo.Context) error {
var err error
// ------------- Path parameter "task_id" -------------
var taskId string
err = runtime.BindStyledParameterWithLocation("simple", false, "task_id", runtime.ParamLocationPath, ctx.Param("task_id"), &taskId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter task_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.SetTaskStatus(ctx, taskId)
return err
}
// GetVersion converts echo context to params.
func (w *ServerInterfaceWrapper) GetVersion(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetVersion(ctx)
return err
}
// DeleteWorkerTag converts echo context to params.
func (w *ServerInterfaceWrapper) DeleteWorkerTag(ctx echo.Context) error {
var err error
// ------------- Path parameter "tag_id" -------------
var tagId string
err = runtime.BindStyledParameterWithLocation("simple", false, "tag_id", runtime.ParamLocationPath, ctx.Param("tag_id"), &tagId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter tag_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.DeleteWorkerTag(ctx, tagId)
return err
}
// FetchWorkerTag converts echo context to params.
func (w *ServerInterfaceWrapper) FetchWorkerTag(ctx echo.Context) error {
var err error
// ------------- Path parameter "tag_id" -------------
var tagId string
err = runtime.BindStyledParameterWithLocation("simple", false, "tag_id", runtime.ParamLocationPath, ctx.Param("tag_id"), &tagId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter tag_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.FetchWorkerTag(ctx, tagId)
return err
}
// UpdateWorkerTag converts echo context to params.
func (w *ServerInterfaceWrapper) UpdateWorkerTag(ctx echo.Context) error {
var err error
// ------------- Path parameter "tag_id" -------------
var tagId string
err = runtime.BindStyledParameterWithLocation("simple", false, "tag_id", runtime.ParamLocationPath, ctx.Param("tag_id"), &tagId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter tag_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.UpdateWorkerTag(ctx, tagId)
return err
}
// FetchWorkerTags converts echo context to params.
func (w *ServerInterfaceWrapper) FetchWorkerTags(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.FetchWorkerTags(ctx)
return err
}
// CreateWorkerTag converts echo context to params.
func (w *ServerInterfaceWrapper) CreateWorkerTag(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.CreateWorkerTag(ctx)
return err
}
// FetchWorkers converts echo context to params.
func (w *ServerInterfaceWrapper) FetchWorkers(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.FetchWorkers(ctx)
return err
}
// DeleteWorker converts echo context to params.
func (w *ServerInterfaceWrapper) DeleteWorker(ctx echo.Context) error {
var err error
// ------------- Path parameter "worker_id" -------------
var workerId string
err = runtime.BindStyledParameterWithLocation("simple", false, "worker_id", runtime.ParamLocationPath, ctx.Param("worker_id"), &workerId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter worker_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.DeleteWorker(ctx, workerId)
return err
}
// FetchWorker converts echo context to params.
func (w *ServerInterfaceWrapper) FetchWorker(ctx echo.Context) error {
var err error
// ------------- Path parameter "worker_id" -------------
var workerId string
err = runtime.BindStyledParameterWithLocation("simple", false, "worker_id", runtime.ParamLocationPath, ctx.Param("worker_id"), &workerId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter worker_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.FetchWorker(ctx, workerId)
return err
}
// RequestWorkerStatusChange converts echo context to params.
func (w *ServerInterfaceWrapper) RequestWorkerStatusChange(ctx echo.Context) error {
var err error
// ------------- Path parameter "worker_id" -------------
var workerId string
err = runtime.BindStyledParameterWithLocation("simple", false, "worker_id", runtime.ParamLocationPath, ctx.Param("worker_id"), &workerId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter worker_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.RequestWorkerStatusChange(ctx, workerId)
return err
}
// SetWorkerTags converts echo context to params.
func (w *ServerInterfaceWrapper) SetWorkerTags(ctx echo.Context) error {
var err error
// ------------- Path parameter "worker_id" -------------
var workerId string
err = runtime.BindStyledParameterWithLocation("simple", false, "worker_id", runtime.ParamLocationPath, ctx.Param("worker_id"), &workerId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter worker_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.SetWorkerTags(ctx, workerId)
return err
}
// FetchWorkerSleepSchedule converts echo context to params.
func (w *ServerInterfaceWrapper) FetchWorkerSleepSchedule(ctx echo.Context) error {
var err error
// ------------- Path parameter "worker_id" -------------
var workerId string
err = runtime.BindStyledParameterWithLocation("simple", false, "worker_id", runtime.ParamLocationPath, ctx.Param("worker_id"), &workerId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter worker_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.FetchWorkerSleepSchedule(ctx, workerId)
return err
}
// SetWorkerSleepSchedule converts echo context to params.
func (w *ServerInterfaceWrapper) SetWorkerSleepSchedule(ctx echo.Context) error {
var err error
// ------------- Path parameter "worker_id" -------------
var workerId string
err = runtime.BindStyledParameterWithLocation("simple", false, "worker_id", runtime.ParamLocationPath, ctx.Param("worker_id"), &workerId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter worker_id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.SetWorkerSleepSchedule(ctx, workerId)
return err
}
// RegisterWorker converts echo context to params.
func (w *ServerInterfaceWrapper) RegisterWorker(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.RegisterWorker(ctx)
return err
}
// SignOff converts echo context to params.
func (w *ServerInterfaceWrapper) SignOff(ctx echo.Context) error {
var err error
ctx.Set(Worker_authScopes, []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.SignOff(ctx)
return err
}
// SignOn converts echo context to params.
func (w *ServerInterfaceWrapper) SignOn(ctx echo.Context) error {
var err error
ctx.Set(Worker_authScopes, []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.SignOn(ctx)
return err
}
// WorkerState converts echo context to params.
func (w *ServerInterfaceWrapper) WorkerState(ctx echo.Context) error {
var err error
ctx.Set(Worker_authScopes, []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.WorkerState(ctx)
return err
}
// WorkerStateChanged converts echo context to params.
func (w *ServerInterfaceWrapper) WorkerStateChanged(ctx echo.Context) error {
var err error
ctx.Set(Worker_authScopes, []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.WorkerStateChanged(ctx)
return err
}
// ScheduleTask converts echo context to params.
func (w *ServerInterfaceWrapper) ScheduleTask(ctx echo.Context) error {
var err error
ctx.Set(Worker_authScopes, []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.ScheduleTask(ctx)
return err
}
// TaskUpdate converts echo context to params.
func (w *ServerInterfaceWrapper) TaskUpdate(ctx echo.Context) error {
var err error
// ------------- Path parameter "task_id" -------------
var taskId string
err = runtime.BindStyledParameterWithLocation("simple", false, "task_id", runtime.ParamLocationPath, ctx.Param("task_id"), &taskId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter task_id: %s", err))
}
ctx.Set(Worker_authScopes, []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.TaskUpdate(ctx, taskId)
return err
}
// MayWorkerRun converts echo context to params.
func (w *ServerInterfaceWrapper) MayWorkerRun(ctx echo.Context) error {
var err error
// ------------- Path parameter "task_id" -------------
var taskId string
err = runtime.BindStyledParameterWithLocation("simple", false, "task_id", runtime.ParamLocationPath, ctx.Param("task_id"), &taskId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter task_id: %s", err))
}
ctx.Set(Worker_authScopes, []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.MayWorkerRun(ctx, taskId)
return err
}
// TaskOutputProduced converts echo context to params.
func (w *ServerInterfaceWrapper) TaskOutputProduced(ctx echo.Context) error {
var err error
// ------------- Path parameter "task_id" -------------
var taskId string
err = runtime.BindStyledParameterWithLocation("simple", false, "task_id", runtime.ParamLocationPath, ctx.Param("task_id"), &taskId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter task_id: %s", err))
}
ctx.Set(Worker_authScopes, []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.TaskOutputProduced(ctx, taskId)
return err
}
// This is a simple interface which specifies echo.Route addition functions which
// are present on both echo.Echo and echo.Group, since we want to allow using
// either of them for path registration
type EchoRouter interface {
CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}
// RegisterHandlers adds each server route to the EchoRouter.
func RegisterHandlers(router EchoRouter, si ServerInterface) {
RegisterHandlersWithBaseURL(router, si, "")
}
// Registers handlers, and prepends BaseURL to the paths, so that the paths
// can be served under a prefix.
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string) {
wrapper := ServerInterfaceWrapper{
Handler: si,
}
router.GET(baseURL+"/api/v3/configuration", wrapper.GetConfiguration)
router.GET(baseURL+"/api/v3/configuration/check/blender", wrapper.FindBlenderExePath)
router.POST(baseURL+"/api/v3/configuration/check/blender", wrapper.CheckBlenderExePath)
router.POST(baseURL+"/api/v3/configuration/check/shared-storage", wrapper.CheckSharedStoragePath)
router.GET(baseURL+"/api/v3/configuration/file", wrapper.GetConfigurationFile)
router.POST(baseURL+"/api/v3/configuration/setup-assistant", wrapper.SaveSetupAssistantConfig)
router.GET(baseURL+"/api/v3/configuration/shared-storage/:audience/:platform", wrapper.GetSharedStorage)
router.GET(baseURL+"/api/v3/configuration/variables/:audience/:platform", wrapper.GetVariables)
router.POST(baseURL+"/api/v3/jobs", wrapper.SubmitJob)
router.POST(baseURL+"/api/v3/jobs/check", wrapper.SubmitJobCheck)
router.GET(baseURL+"/api/v3/jobs/last-rendered", wrapper.FetchGlobalLastRenderedInfo)
router.DELETE(baseURL+"/api/v3/jobs/mass-delete", wrapper.DeleteJobMass)
router.POST(baseURL+"/api/v3/jobs/query", wrapper.QueryJobs)
router.GET(baseURL+"/api/v3/jobs/type/:typeName", wrapper.GetJobType)
router.GET(baseURL+"/api/v3/jobs/types", wrapper.GetJobTypes)
router.DELETE(baseURL+"/api/v3/jobs/:job_id", wrapper.DeleteJob)
router.GET(baseURL+"/api/v3/jobs/:job_id", wrapper.FetchJob)
router.DELETE(baseURL+"/api/v3/jobs/:job_id/blocklist", wrapper.RemoveJobBlocklist)
router.GET(baseURL+"/api/v3/jobs/:job_id/blocklist", wrapper.FetchJobBlocklist)
router.GET(baseURL+"/api/v3/jobs/:job_id/last-rendered", wrapper.FetchJobLastRenderedInfo)
router.POST(baseURL+"/api/v3/jobs/:job_id/setpriority", wrapper.SetJobPriority)
router.POST(baseURL+"/api/v3/jobs/:job_id/setstatus", wrapper.SetJobStatus)
router.GET(baseURL+"/api/v3/jobs/:job_id/tasks", wrapper.FetchJobTasks)
router.GET(baseURL+"/api/v3/jobs/:job_id/what-would-delete-do", wrapper.DeleteJobWhatWouldItDo)
router.POST(baseURL+"/api/v3/shaman/checkout/create", wrapper.ShamanCheckout)
router.POST(baseURL+"/api/v3/shaman/checkout/requirements", wrapper.ShamanCheckoutRequirements)
router.GET(baseURL+"/api/v3/shaman/files/:checksum/:filesize", wrapper.ShamanFileStoreCheck)
router.POST(baseURL+"/api/v3/shaman/files/:checksum/:filesize", wrapper.ShamanFileStore)
router.GET(baseURL+"/api/v3/status", wrapper.GetFarmStatus)
router.GET(baseURL+"/api/v3/tasks/:task_id", wrapper.FetchTask)
router.GET(baseURL+"/api/v3/tasks/:task_id/log", wrapper.FetchTaskLogInfo)
router.GET(baseURL+"/api/v3/tasks/:task_id/logtail", wrapper.FetchTaskLogTail)
router.POST(baseURL+"/api/v3/tasks/:task_id/setstatus", wrapper.SetTaskStatus)
router.GET(baseURL+"/api/v3/version", wrapper.GetVersion)
router.DELETE(baseURL+"/api/v3/worker-mgt/tag/:tag_id", wrapper.DeleteWorkerTag)
router.GET(baseURL+"/api/v3/worker-mgt/tag/:tag_id", wrapper.FetchWorkerTag)
router.PUT(baseURL+"/api/v3/worker-mgt/tag/:tag_id", wrapper.UpdateWorkerTag)
router.GET(baseURL+"/api/v3/worker-mgt/tags", wrapper.FetchWorkerTags)
router.POST(baseURL+"/api/v3/worker-mgt/tags", wrapper.CreateWorkerTag)
router.GET(baseURL+"/api/v3/worker-mgt/workers", wrapper.FetchWorkers)
router.DELETE(baseURL+"/api/v3/worker-mgt/workers/:worker_id", wrapper.DeleteWorker)
router.GET(baseURL+"/api/v3/worker-mgt/workers/:worker_id", wrapper.FetchWorker)
router.POST(baseURL+"/api/v3/worker-mgt/workers/:worker_id/setstatus", wrapper.RequestWorkerStatusChange)
router.POST(baseURL+"/api/v3/worker-mgt/workers/:worker_id/settags", wrapper.SetWorkerTags)
router.GET(baseURL+"/api/v3/worker-mgt/workers/:worker_id/sleep-schedule", wrapper.FetchWorkerSleepSchedule)
router.POST(baseURL+"/api/v3/worker-mgt/workers/:worker_id/sleep-schedule", wrapper.SetWorkerSleepSchedule)
router.POST(baseURL+"/api/v3/worker/register-worker", wrapper.RegisterWorker)
router.POST(baseURL+"/api/v3/worker/sign-off", wrapper.SignOff)
router.POST(baseURL+"/api/v3/worker/sign-on", wrapper.SignOn)
router.GET(baseURL+"/api/v3/worker/state", wrapper.WorkerState)
router.POST(baseURL+"/api/v3/worker/state-changed", wrapper.WorkerStateChanged)
router.POST(baseURL+"/api/v3/worker/task", wrapper.ScheduleTask)
router.POST(baseURL+"/api/v3/worker/task/:task_id", wrapper.TaskUpdate)
router.GET(baseURL+"/api/v3/worker/task/:task_id/may-i-run", wrapper.MayWorkerRun)
router.POST(baseURL+"/api/v3/worker/task/:task_id/output-produced", wrapper.TaskOutputProduced)
}