debian-forge-composer/internal/worker/json.go
Major Hayden 0921643fa3 Add health check at /status
There are times where it would be good to monitor that osbuild-composer
is up and running. Add a very simple status check that always returns
200/OK. This can be expanded later to verify that other parts of
osbuild-composer are working properly.

Signed-off-by: Major Hayden <major@redhat.com>
2020-05-26 15:34:16 -05:00

51 lines
1 KiB
Go

package worker
import (
"github.com/google/uuid"
"github.com/osbuild/osbuild-composer/internal/common"
"github.com/osbuild/osbuild-composer/internal/osbuild"
"github.com/osbuild/osbuild-composer/internal/target"
)
//
// JSON-serializable types for the jobqueue
//
type OSBuildJob struct {
Manifest *osbuild.Manifest `json:"manifest"`
Targets []*target.Target `json:"targets,omitempty"`
}
type OSBuildJobResult struct {
OSBuildOutput *common.ComposeResult `json:"osbuild_output,omitempty"`
}
//
// JSON-serializable types for the HTTP API
//
type statusResponse struct {
Status string `json:"status"`
}
type errorResponse struct {
Message string `json:"message"`
}
type addJobRequest struct {
}
type addJobResponse struct {
Id uuid.UUID `json:"id"`
Manifest *osbuild.Manifest `json:"manifest"`
Targets []*target.Target `json:"targets,omitempty"`
}
type updateJobRequest struct {
Status common.ImageBuildState `json:"status"`
Result *common.ComposeResult `json:"result"`
}
type updateJobResponse struct {
}