service

package
v0.0.0-...-e8da0a6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateService

func CreateService(ctx echo.Context) error

@Description Create a Service @Accept json @Produce json @Tags /api/v1/service @Router /api/v1/cluster/{cluster_uuid}/service [post] @Param cluster_uuid path string true "cluster UUID" @Param service body Create true "Create" @Success 200 {object} ServiceResponse

func CreateServiceMultiClusters

func CreateServiceMultiClusters(ctx echo.Context) error

@Description Create a Service (Multi Clusters) @Accept json @Produce json @Tags /api/v1/service @Router /api/v1/service [post] @Param service body Create true "Create" @Success 200 {array} ServiceResponse

func FindService

func FindService(ctx echo.Context) (err error)

@Description Find Services @Accept x-www-form-urlencoded @Produce json @Tags /api/v1/service @Router /api/v1/service [get] @Param q query string false "query github.com/claion-org/claiflow/pkg/server/database/vanilla/stmt/README.md" @Param o query string false "order github.com/claion-org/claiflow/pkg/server/database/vanilla/stmt/README.md" @Param p query string false "paging github.com/claion-org/claiflow/pkg/server/database/vanilla/stmt/README.md" @Success 200 {array} ServiceResponse

func GetService

func GetService(ctx echo.Context) (err error)

@Description Get a Service @Accept json @Produce json @Tags /api/v1/service @Router /api/v1/cluster/{cluster_uuid}/service/{uuid} [get] @Param cluster_uuid path string true "cluster UUID" @Param uuid path string true "service UUID" @Success 200 {object} ServiceResponse

func GetServiceResult

func GetServiceResult(ctx echo.Context) (err error)

@Description Get a Service Result @Accept json @Produce json @Tags /api/v1/service @Router /api/v1/cluster/{cluster_uuid}/service/{uuid}/result [get] @Param cluster_uuid path string true "cluster UUID" @Param uuid path string true "service UUID" @Success 200 {object} ResultResponse

func NewServiceWithStatus

func NewServiceWithStatus(body CreateMultiClusters, tmpl model.Template, nowTime time.Time) []model.ServiceWithStatuses

func ValidCreateService

func ValidCreateService(ctx context.Context, body CreateMultiClusters, tmpl model.Template) error

Types

type Create

type Create struct {
	UUID              *string `json:"uuid,omitempty"` // (optional)
	Name              string  `json:"name"`
	Summary           *string `json:"summary,omitempty"`
	TemplateUUID      string  `json:"template_uuid"`
	Inputs            Object  `json:"inputs"`
	SubscribedChannel *string `json:"subscribed_channel,omitempty"`
}

type CreateMultiClusters

type CreateMultiClusters struct {
	ClusterUUIDs      []string `json:"cluster_uuids"`
	UUID              *string  `json:"uuid,omitempty"` // (optional)
	Name              string   `json:"name"`
	Summary           *string  `json:"summary,omitempty"`
	TemplateUUID      string   `json:"template_uuid"`
	Inputs            Object   `json:"inputs"`
	SubscribedChannel *string  `json:"subscribed_channel,omitempty"`
}

type Object

type Object = map[string]any

type ResultResponse

type ResultResponse struct {
	ResultSaveType model.ResultSaveType `json:"save_type"`
	Result         string               `json:"result"`
	Created        time.Time            `json:"created"`
}

func NewResultResponse

func NewResultResponse(result model.ClusterServiceResult) ResultResponse

type ServiceResponse

type ServiceResponse struct {
	ClusterUUID       string           `json:"cluster_uuid"`
	UUID              string           `json:"uuid"`
	Name              string           `json:"name"`
	Summary           *string          `json:"summary,omitempty"`
	TemplateUUID      string           `json:"template_uuid"`
	Flow              string           `json:"flow"`
	Inputs            Object           `json:"inputs" swaggertype:"object"`
	StepMax           int              `json:"step_max"`
	SubscribedChannel *string          `json:"subscribed_channel,omitempty"`
	Priority          model.Priority   `json:"priority"`
	Created           time.Time        `json:"created"`
	Statuses          []StatusResponse `json:"statuses,omitempty"`
	Result            []ResultResponse `json:"results,omitempty"`
}

func NewServiceResponse

func NewServiceResponse(service model.ClusterService, statuses []model.ClusterServiceStatus, results []model.ClusterServiceResult) ServiceResponse

type StatusResponse

type StatusResponse struct {
	StepSeq int              `json:"step_seq"`
	Status  model.StepStatus `json:"status"`
	Started *time.Time       `json:"started,omitempty"`
	Ended   *time.Time       `json:"ended,omitempty"`
	Message *string          `json:"message,omitempty"`
	Created time.Time        `json:"created"`
}

func NewStatusResponse

func NewStatusResponse(status model.ClusterServiceStatus) StatusResponse

type Update

type Update struct {
	Uuid     string           `json:"uuid"`
	Sequence int              `json:"sequence"`
	Status   model.StepStatus `json:"status"`
	Result   string           `json:"result"`
	Started  time.Time        `json:"started"`
	Ended    time.Time        `json:"ended"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL