manager

package
v0.0.0-...-03bec22 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FailureResponse

type FailureResponse struct {
	Status string `json:"status"`
	Error  string `json:"error"`
}

FailureResponse - response for a failed operation

type JobDetailsResponse

type JobDetailsResponse struct {
	Job      *model.Job         `json:"job"`
	Messages []messages.Message `json:"messages"`
}

JobDetailsResponse - response with job details

type JobListResponse

type JobListResponse struct {
	Jobs []model.Job `json:"jobs"`
}

JobListResponse - response with a list of jobs

type ManagerAPI

type ManagerAPI struct {
	// contains filtered or unexported fields
}

func CreateManagerAPI

func CreateManagerAPI(
	gin *gin.Engine,
	dipscl *dipscl.Client,
	mongo *mongo.Database,
	messageHandler messages.MessageHandler,
) (*ManagerAPI, error)

CreateManagerAPI - adds the manager api to a gin engine

func (*ManagerAPI) JobDetails

func (a *ManagerAPI) JobDetails(c *gin.Context)

JobDetails - find a single job by it's id and shows all fields @Summary find a single job by it's id and shows all fields @Description This method will return a single job by it's id or an error. @ID job-details @Tags jobs @Produce json @Param job_id path string true "Job ID" @Success 200 {object} JobDetailsResponse @Failure 400 {object} FailureResponse @Router /manager/job/details/{job_id} [get]

func (*ManagerAPI) JobList

func (a *ManagerAPI) JobList(c *gin.Context)

JobList - lists all jobs @Summary lists all jobs @Description This method will return a list of all jobs @ID job-list @Tags jobs @Produce json @Success 200 {object} JobListResponse @Failure 400 {object} FailureResponse @Router /manager/job/all [get]

func (*ManagerAPI) PipelineCreate

func (a *ManagerAPI) PipelineCreate(c *gin.Context)

PipelineCreate - creates a pipeline @Summary creates a pipeline @Description This method will create the pipeline sent via the post body @ID pipeline-create @Tags pipelines @Accept plain @Produce json @Param pipeline body string true "Pipeline Script" @Success 200 {object} PipelineCreateResponse @Failure 400 {object} FailureResponse @Router /manager/pipeline/ [post]

func (*ManagerAPI) PipelineDelete

func (a *ManagerAPI) PipelineDelete(c *gin.Context)

PipelineDelete - deletes the pipeline with the given id @Summary deletes the pipeline with the given id @Description This method will delete the given pipeline @ID pipeline-delete @Tags pipelines @Produce json @Param pipeline_id path string true "Pipeline ID" @Success 200 {object} SuccessResponse @Failure 400 {object} FailureResponse @Router /manager/pipeline/{pipeline_id} [delete]

func (*ManagerAPI) PipelineDetails

func (a *ManagerAPI) PipelineDetails(c *gin.Context)

PipelineDetails - find a pipeline by it's id and shows all fields @Summary find a pipeline by it's id and shows all fields @Description This method will return a single pipeline by it's id or an error. @ID pipeline-details @Tags pipelines @Produce json @Param pipeline_id path string true "Pipeline ID" @Success 200 {object} PipelineDetailsResponse @Failure 400 {object} FailureResponse @Router /manager/pipeline/details/{pipeline_id} [get]

func (*ManagerAPI) PipelineExecute

func (a *ManagerAPI) PipelineExecute(c *gin.Context)

PipelineExecute - executes a pipeline @Summary executes a pipeline @Description This method will execute the pipeline with the given id @ID pipeline-execute @Tags pipelines @Accept json @Produce json @Param pipeline_id path string true "Pipeline ID" @Param execute_request body PipelineExecuteRequest true "Request Body" @Success 200 {object} PipelineExecuteResponse @Failure 400 {object} FailureResponse @Router /manager/pipeline/execute/{pipeline_id} [post]

func (*ManagerAPI) PipelineList

func (a *ManagerAPI) PipelineList(c *gin.Context)

PipelineList - lists all registered pipelines @Summary lists all registered pipelines @Description This method will return a list of all registered pipelines @ID pipeline-list @Tags pipelines @Produce json @Success 200 {object} PipelineListResponse @Failure 400 {object} FailureResponse @Router /manager/pipeline/all [get]

func (*ManagerAPI) PipelineUpdate

func (a *ManagerAPI) PipelineUpdate(c *gin.Context)

PipelineUpdate - updates the pipeline with the given id @Summary updates the pipeline with the given id @Description This method will update the given pipeline from a provided script @ID pipeline-update @Tags pipelines @Accept plain @Produce json @Param pipeline_id path string true "Pipeline ID" @Param pipeline body string true "Pipeline Script" @Success 200 {object} PipelineDetailsResponse @Failure 400 {object} FailureResponse @Router /manager/pipeline/{pipeline_id} [patch]

type PipelineCreateResponse

type PipelineCreateResponse struct {
	Status   string         `json:"status"`
	Pipeline model.Pipeline `json:"pipeline"`
}

PipelineCreateResponse - reponse for a successful pipeline creation

type PipelineDetailsResponse

type PipelineDetailsResponse struct {
	Pipeline *model.Pipeline `json:"pipeline"`
}

PipelineDetailsResponse - response with pipeline details

type PipelineExecuteRequest

type PipelineExecuteRequest struct {
	Name       string                 `json:"name"`
	Parameters map[string]interface{} `json:"parameters"`
}

PipelineExecuteRequest - Request Body when executing a pipeline

type PipelineExecuteResponse

type PipelineExecuteResponse struct {
	Job *model.Job `json:"job"`
}

PipelineExecuteResponse - Response when a pipeline was started

type PipelineListResponse

type PipelineListResponse struct {
	Pipelines []model.Pipeline `json:"pipelines"`
}

PipelineListResponse - response with a list of pipelines

type SuccessResponse

type SuccessResponse struct {
	Status string `json:"status"`
}

SuccessResponse - reponse for a successful operation

Jump to

Keyboard shortcuts

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