handler

package
v0.0.0-...-318a3d5 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeInputData

func DecodeInputData(body io.ReadCloser, params any) error

func GracefulShutdownMiddleware

func GracefulShutdownMiddleware(wg *sync.WaitGroup) gin.HandlerFunc

GracefulShutdownMiddleware synchronize active handlers to enable graceful shutdown

func NewSequenceExecutionHandler

func NewSequenceExecutionHandler(sequenceExecutionRepo db.SequenceExecutionRepo, projectRepo db.ProjectRepo) *sequenceExecutionHandler

func NewServiceManager

func NewServiceManager(servicesDBOperations db.ProjectMVRepo, configurationStore configurationstore.ConfigurationStore, uniformRepo db.UniformRepo) *serviceManager

func SetBadRequestErrorResponse

func SetBadRequestErrorResponse(c *gin.Context, msg string)

func SetConflictErrorResponse

func SetConflictErrorResponse(c *gin.Context, msg string)

func SetFailedDependencyErrorResponse

func SetFailedDependencyErrorResponse(c *gin.Context, msg string)

func SetInternalServerErrorResponse

func SetInternalServerErrorResponse(c *gin.Context, msg string)

func SetNotFoundErrorResponse

func SetNotFoundErrorResponse(c *gin.Context, msg string)

func SetUnprocessableEntityResponse

func SetUnprocessableEntityResponse(c *gin.Context, msg string)

func WithHideAutoProvisionedURL

func WithHideAutoProvisionedURL(hideAutoProvisionedURL bool) func(pm *ProjectManager)

Types

type DebugHandler

type DebugHandler struct {
	DebugManager IDebugManager
}

func NewDebugHandler

func NewDebugHandler(debugManager IDebugManager) *DebugHandler

func (*DebugHandler) GetAllEvents

func (dh *DebugHandler) GetAllEvents(c *gin.Context)

func (*DebugHandler) GetAllSequencesForProject

func (dh *DebugHandler) GetAllSequencesForProject(c *gin.Context)

func (*DebugHandler) GetBlockingSequences

func (dh *DebugHandler) GetBlockingSequences(c *gin.Context)

func (*DebugHandler) GetDatabaseDump

func (dh *DebugHandler) GetDatabaseDump(c *gin.Context)

func (*DebugHandler) GetEventByID

func (dh *DebugHandler) GetEventByID(c *gin.Context)

func (*DebugHandler) GetSequenceByID

func (dh *DebugHandler) GetSequenceByID(c *gin.Context)

func (*DebugHandler) ListAllCollections

func (dh *DebugHandler) ListAllCollections(c *gin.Context)

type DebugManager

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

func NewDebugManager

func NewDebugManager(eventRepo db.EventRepo, stateRepo db.SequenceStateRepo, projectsRepo db.ProjectRepo, sequenceExecutionRepo db.SequenceExecutionRepo, dbDumpRepo db.DBDumpRepo) *DebugManager

func (*DebugManager) GetAllEvents

func (dm *DebugManager) GetAllEvents(projectName string, shkeptncontext string) ([]*apimodels.KeptnContextExtendedCE, error)

func (*DebugManager) GetAllProjects

func (dm *DebugManager) GetAllProjects() ([]*apimodels.ExpandedProject, error)

func (*DebugManager) GetAllSequencesForProject

func (dm *DebugManager) GetAllSequencesForProject(projectName string, paginationParams models.PaginationParams) ([]models.SequenceExecution, *models.PaginationResult, error)

func (*DebugManager) GetBlockingSequences

func (dm *DebugManager) GetBlockingSequences(projectName string, shkeptncontext string, stage string) ([]models.SequenceExecution, error)

func (*DebugManager) GetDatabaseDump

func (dm *DebugManager) GetDatabaseDump(collectionName string) ([]bson.M, error)

func (*DebugManager) GetEventByID

func (dm *DebugManager) GetEventByID(projectName string, shkeptncontext string, eventId string) (*apimodels.KeptnContextExtendedCE, error)

func (*DebugManager) GetSequenceByID

func (dm *DebugManager) GetSequenceByID(projectName string, shkeptncontext string) (*apimodels.SequenceState, error)

func (*DebugManager) ListAllCollections

func (dm *DebugManager) ListAllCollections() ([]string, error)

type EvaluationHandler

type EvaluationHandler struct {
	EvaluationManager IEvaluationManager
}

func NewEvaluationHandler

func NewEvaluationHandler(evaluationManager IEvaluationManager) *EvaluationHandler

func (*EvaluationHandler) CreateEvaluation

func (eh *EvaluationHandler) CreateEvaluation(c *gin.Context)

CreateEvaluation triggers a new evaluation @Summary Trigger a new evaluation @Description Trigger a new evaluation for a service within a project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}events:write</span> @Tags Evaluation @Security ApiKeyAuth @Accept json @Produce json @Param project path string true "Project" @Param stage path string true "Stage" @Param service path string true "Service" @Param evaluation body models.CreateEvaluationParams true "Evaluation" @Success 200 {object} models.CreateEvaluationResponse "ok" @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{project}/stage/{stage}/service/{service}/evaluation [post]

type EvaluationManager

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

func NewEvaluationManager

func NewEvaluationManager(eventSender keptn.EventSender, projectMVRepo db.ProjectMVRepo) (*EvaluationManager, error)

func (*EvaluationManager) CreateEvaluation

func (em *EvaluationManager) CreateEvaluation(project, stage, service string, params *models.CreateEvaluationParams) (*models.CreateEvaluationResponse, *models.Error)

type EvaluationParamsValidator

type EvaluationParamsValidator struct{}

func (EvaluationParamsValidator) Validate

func (e EvaluationParamsValidator) Validate(params interface{}) error

type EventHandler

type EventHandler struct {
	ShipyardController controller.IShipyardController
}

func (*EventHandler) GetTriggeredEvents

func (eh *EventHandler) GetTriggeredEvents(c *gin.Context)

GetTriggeredEvents godoc @Summary Get triggered events @Description get triggered events by their type @Tags Events @Security ApiKeyAuth @Accept json @Produce json @Param eventType path string true "Event type" @Param eventID query string false "Event ID" @Param project query string false "Project" @Param stage query string false "Stage" @Param service query string false "Service" @Success 200 {object} apimodels.KeptnContextExtendedCE "ok" @Failure 400 {object} models.Error "Invalid payload" @Failure 404 {object} models.Error "Not found" @Failure 500 {object} models.Error "Internal error" @Router /event/triggered/{eventType} [get]

func (*EventHandler) HandleEvent

func (eh *EventHandler) HandleEvent(c *gin.Context)

type HealthHandler

type HealthHandler struct {
	db.MongoDBConnection
}

func NewHealthHandler

func NewHealthHandler() *HealthHandler

func (*HealthHandler) Health

func (h *HealthHandler) Health(c *gin.Context)

type IDebugHandler

type IDebugHandler interface {
	GetSequenceByID(context *gin.Context)
	GetAllSequencesForProject(context *gin.Context)
	GetAllEvents(context *gin.Context)
	GetEventByID(context *gin.Context)
	GetBlockingSequences(context *gin.Context)
	GetDatabaseDump(c *gin.Context)
	ListAllCollections(c *gin.Context)
}

type IDebugManager

type IDebugManager interface {
	GetAllProjects() ([]*apimodels.ExpandedProject, error)
	GetSequenceByID(projectName string, shkeptncontext string) (*apimodels.SequenceState, error)
	GetAllSequencesForProject(projectName string, paginationParams models.PaginationParams) ([]models.SequenceExecution, *models.PaginationResult, error)
	GetAllEvents(projectName string, shkeptncontext string) ([]*apimodels.KeptnContextExtendedCE, error)
	GetEventByID(projectName string, shkeptncontext string, eventId string) (*apimodels.KeptnContextExtendedCE, error)
	GetBlockingSequences(projectName string, shkeptncontext string, stage string) ([]models.SequenceExecution, error)
	GetDatabaseDump(collectionName string) ([]bson.M, error)
	ListAllCollections() ([]string, error)
}

type IEvaluationHandler

type IEvaluationHandler interface {
	CreateEvaluation(context *gin.Context)
}

type IEvaluationManager

type IEvaluationManager interface {
	CreateEvaluation(project, stage, service string, params *models.CreateEvaluationParams) (*models.CreateEvaluationResponse, *models.Error)
}

type IEventHandler

type IEventHandler interface {
	GetTriggeredEvents(context *gin.Context)
	HandleEvent(context *gin.Context)
}

func NewEventHandler

func NewEventHandler(shipyardController controller.IShipyardController) IEventHandler

NewEventHandler creates a new EventHandler

type IEventSender

type IEventSender interface {
	SendEvent(event cloudevents.Event) error
	Send(ctx context.Context, event cloudevents.Event) error
}

type IHealthHandler

type IHealthHandler interface {
	Health(context *gin.Context)
}

type ILogHandler

type ILogHandler interface {
	CreateLogEntries(context *gin.Context)
	GetLogEntries(context *gin.Context)
	DeleteLogEntries(context *gin.Context)
}

type ILogManager

type ILogManager interface {
	CreateLogEntries(entry models.CreateLogsRequest) error
	GetLogEntries(filter models.GetLogParams) (*models.GetLogsResponse, error)
	DeleteLogEntries(params models.DeleteLogParams) error
}

type IProjectHandler

type IProjectHandler interface {
	GetAllProjects(context *gin.Context)
	GetProjectByName(context *gin.Context)
	CreateProject(context *gin.Context)
	UpdateProject(context *gin.Context)
	DeleteProject(context *gin.Context)
}

type IProjectManager

type IProjectManager interface {
	Get() ([]*apimodels.ExpandedProject, error)
	GetByName(projectName string) (*apimodels.ExpandedProject, error)
	Create(params *models.CreateProjectParams, internalOptions models.InternalCreateProjectOptions) (error, common.RollbackFunc)
	Update(params *models.UpdateProjectParams) (error, common.RollbackFunc)
	Delete(projectName string) (string, error)
}

type IServiceHandler

type IServiceHandler interface {
	CreateService(context *gin.Context)
	DeleteService(context *gin.Context)
	GetService(context *gin.Context)
	GetServices(context *gin.Context)
}

func NewServiceHandler

func NewServiceHandler(serviceManager IServiceManager, eventSender common.EventSender, env config.EnvConfig) IServiceHandler

type IServiceManager

type IServiceManager interface {
	CreateService(projectName string, params *models.CreateServiceParams) error
	DeleteService(projectName, serviceName string) error
	GetService(projectName, stageName, serviceName string) (*apimodels.ExpandedService, error)
	GetAllServices(projectName, stageName string) ([]*apimodels.ExpandedService, error)
}

type IStageHandler

type IStageHandler interface {
	GetAllStages(context *gin.Context)
	GetStage(context *gin.Context)
}

type IStageManager

type IStageManager interface {
	GetAllStages(projectName string) ([]*apimodels.ExpandedStage, error)
	GetStage(projectName, stageName string) (*apimodels.ExpandedStage, error)
}

type IStateHandler

type IStateHandler interface {
	GetSequenceState(context *gin.Context)
	ControlSequenceState(context *gin.Context)
}

type IUniformIntegrationHandler

type IUniformIntegrationHandler interface {
	Register(context *gin.Context)
	KeepAlive(context *gin.Context)
	Unregister(context *gin.Context)
	GetRegistrations(context *gin.Context)
	GetSubscription(context *gin.Context)
	GetSubscriptions(c *gin.Context)
	CreateSubscription(c *gin.Context)
	DeleteSubscription(c *gin.Context)
	UpdateSubscription(c *gin.Context)
}

type LogHandler

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

func NewLogHandler

func NewLogHandler(logManager ILogManager) *LogHandler

func (*LogHandler) CreateLogEntries

func (lh *LogHandler) CreateLogEntries(context *gin.Context)

CreateLogEntries persists log entries @Summary Persist a list of log entries @Description Persist a list of log entries @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}logs:write</span> @Tags Log @Security ApiKeyAuth @Accept json @Produce json @Param integration body models.CreateLogsRequest true "Logs" @Success 200 @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /log [post]

func (*LogHandler) DeleteLogEntries

func (lh *LogHandler) DeleteLogEntries(context *gin.Context)

DeleteLogEntries @Summary Delete logs @Deprecated true @Description INTERNAL Endpoint: Delete logs @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}logs:delete</span> @Tags Log @Security ApiKeyAuth @Accept json @Produce json @Param integrationId query string false "integrationId" @Param fromTime query string false "The from time stamp for fetching sequence states" @Param beforeTime query string false "The before time stamp for fetching sequence states" @Success 200 {object} models.DeleteLogResponse "ok" @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /log [delete]

func (*LogHandler) GetLogEntries

func (lh *LogHandler) GetLogEntries(context *gin.Context)

GetLogEntries Retrieves log entries based on the provided filter @Summary Retrieve logs @Description Retrieve logs @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}logs:read</span> @Tags Log @Security ApiKeyAuth @Accept json @Produce json @Param integrationId query string false "integrationId" @Param fromTime query string false "The from time stamp for fetching sequence states" @Param beforeTime query string false "The before time stamp for fetching sequence states" @Param pageSize query int false "The number of items to return" @Param nextPageKey query string false "Pointer to the next set of items" @Success 200 {object} models.GetLogsResponse "ok" @Failure 400 {object} models.Error "Invalid payload" @Failure 404 {object} models.Error "Not found" @Router /log [get]

type LogManager

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

func NewLogManager

func NewLogManager(logRepo db.LogRepo) *LogManager

func (*LogManager) CreateLogEntries

func (lm *LogManager) CreateLogEntries(entries models.CreateLogsRequest) error

func (*LogManager) DeleteLogEntries

func (lm *LogManager) DeleteLogEntries(params models.DeleteLogParams) error

func (*LogManager) GetLogEntries

func (lm *LogManager) GetLogEntries(filter models.GetLogParams) (*models.GetLogsResponse, error)

type ProjectHandler

type ProjectHandler struct {
	ProjectManager        IProjectManager
	EventSender           common.EventSender
	Env                   config.EnvConfig
	RepositoryProvisioner provisioner.IRepositoryProvisioner
	RemoteURLValidator    provisioner.RemoteURLValidator
}

func NewProjectHandler

func NewProjectHandler(projectManager IProjectManager, eventSender common.EventSender, env config.EnvConfig, repositoryProvisioner provisioner.IRepositoryProvisioner, remoteURLValidator provisioner.RemoteURLValidator) *ProjectHandler

func (*ProjectHandler) CreateProject

func (ph *ProjectHandler) CreateProject(c *gin.Context)

CreateProject godoc @Summary Create a new project @Description Create a new project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}projects:write</span> @Tags Projects @Security ApiKeyAuth @Accept json @Produce json @Param project body models.CreateProjectParams true "Project" @Success 201 {object} models.CreateProjectResponse "ok" @Failure 400 {object} models.Error "Invalid payload" @Failure 409 {object} models.Error "Conflict" @Failure 424 {object} models.Error "Failed dependency" @Failure 500 {object} models.Error "Internal error" @Router /project [post]

func (*ProjectHandler) DeleteProject

func (ph *ProjectHandler) DeleteProject(c *gin.Context)

DeleteProject godoc @Summary Delete a project @Description Delete a project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}projects:delete</span> @Tags Projects @Security ApiKeyAuth @Accept json @Produce json @Param project path string true "Project name" @Success 200 {object} models.DeleteProjectResponse "ok" @Failure 400 {object} models.Error "Invalid payload" @Failure 424 {object} models.Error "Failed Dependency" @Failure 500 {object} models.Error "Internal error" @Router /project/{project} [delete]

func (*ProjectHandler) GetAllProjects

func (ph *ProjectHandler) GetAllProjects(c *gin.Context)

GetAllProjects godoc @Summary Get all projects @Description Get the list of all projects @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}projects:read</span> @Tags Projects @Security ApiKeyAuth @Accept json @Produce json @Param pageSize query int false "The number of items to return" @Param nextPageKey query string false "Pointer to the next set of items" @Param disableUpstreamSync query boolean false "Disable sync of upstream repo before reading content" @Success 200 {object} apimodels.ExpandedProjects "ok" @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project [get]

func (*ProjectHandler) GetProjectByName

func (ph *ProjectHandler) GetProjectByName(c *gin.Context)

GetProjectByName godoc @Summary Get a project by name @Description Get a project by its name @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}projects:read</span> @Tags Projects @Security ApiKeyAuth @Accept json @Produce json @Param project path string true "The name of the project" @Success 200 {object} apimodels.ExpandedProject "ok" @Failure 404 {object} models.Error "Not found" @Failure 500 {object} models.Error "Internal Error) @Router /project/{project} [get]

func (*ProjectHandler) UpdateProject

func (ph *ProjectHandler) UpdateProject(c *gin.Context)

UpdateProject godoc @Summary Updates a project @Description Updates project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}projects:write</span> @Tags Projects @Security ApiKeyAuth @Accept json @Produce json @Param project body models.UpdateProjectParams true "Project" @Success 201 {object} models.UpdateProjectResponse "ok" @Failure 400 {object} models.Error "Bad Request" @Failure 404 {object} models.Error "Not Found" @Failure 424 {object} models.Error "Failed Dependency" @Failure 500 {object} models.Error "Internal error" @Router /project [put]

type ProjectManager

type ProjectManager struct {
	ConfigurationStore      configurationstore.ConfigurationStore
	SecretStore             secretstore.SecretStore
	ProjectMaterializedView db.ProjectMVRepo
	SequenceExecutionRepo   db.SequenceExecutionRepo
	EventRepository         db.EventRepo
	SequenceQueueRepo       db.SequenceQueueRepo
	EventQueueRepo          db.EventQueueRepo
	// contains filtered or unexported fields
}

func NewProjectManager

func NewProjectManager(
	configurationStore configurationstore.ConfigurationStore,
	secretStore secretstore.SecretStore,
	projectMVrepo db.ProjectMVRepo,
	sequenceExecutionRepo db.SequenceExecutionRepo,
	eventRepo db.EventRepo,
	sequenceQueueRepo db.SequenceQueueRepo,
	eventQueueRepo db.EventQueueRepo,
	opts ...func(pm *ProjectManager)) *ProjectManager

func (*ProjectManager) Create

func (*ProjectManager) Delete

func (pm *ProjectManager) Delete(projectName string) (string, error)

func (*ProjectManager) Get

func (*ProjectManager) GetByName

func (pm *ProjectManager) GetByName(projectName string) (*apimodels.ExpandedProject, error)

func (*ProjectManager) Update

type ProjectValidator

type ProjectValidator struct {
	ProjectNameMaxSize       int
	AutomaticProvisioningURL string
}

func (ProjectValidator) Validate

func (p ProjectValidator) Validate(params interface{}) error

type SequenceExecutionHandler

type SequenceExecutionHandler interface {
	GetSequenceExecutions(context *gin.Context)
}

type ServiceHandler

type ServiceHandler struct {
	EventSender common.EventSender
	Env         config.EnvConfig
	// contains filtered or unexported fields
}

func (*ServiceHandler) CreateService

func (sh *ServiceHandler) CreateService(c *gin.Context)

CreateService godoc @Summary Create a new service @Description Create a new service @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}services:write</span> @Tags Services @Security ApiKeyAuth @Accept json @Produce json @Param project path string true "Project" @Param service body models.CreateServiceParams true "Project" @Success 200 {object} models.CreateServiceResponse "ok" @Failure 400 {object} models.Error "Invalid payload" @Failure 409 {object} models.Error "Conflict" @Failure 500 {object} models.Error "Internal error" @Router /project/{project}/service [post]

func (*ServiceHandler) DeleteService

func (sh *ServiceHandler) DeleteService(c *gin.Context)

DeleteService godoc @Summary Delete a service @Description Delete a service @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}services:delete</span> @Tags Services @Security ApiKeyAuth @Accept json @Produce json @Param project path string true "Project" @Param service path string true "Service" @Success 200 {object} models.DeleteServiceResponse "ok" @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{project}/service/{service} [delete]

func (*ServiceHandler) GetService

func (sh *ServiceHandler) GetService(c *gin.Context)

GetService godoc @Summary Gets a service by its name @Description Gets a service by its name @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}services:read</span> @Tags Services @Security ApiKeyAuth @Accept json @Produce json @Param project path string true "Project" @Param stage path string true "Stage" @Param service path string true "Service" @Success 200 {object} apimodels.ExpandedService "ok" @Failure 404 {object} models.Error "Not found" @Failure 500 {object} models.Error "Internal error" @Router /project/{project}/stage/{stage}/service/{service} [get]

func (*ServiceHandler) GetServices

func (sh *ServiceHandler) GetServices(c *gin.Context)

GetServices godoc @Summary Gets all services of a stage in a project @Description Gets all services of a stage in a project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}stages:read</span> @Tags Services @Security ApiKeyAuth @Accept json @Produce json @Param project path string true "Project" @Param stage path string true "Stage" @Param pageSize query int false "The number of items to return" @Param nextPageKey query string false "Pointer to the next set of items" @Success 200 {object} apimodels.ExpandedServices "ok" @Failure 400 {object} models.Error "Invalid payload" @Failure 404 {object} models.Error "Not found" @Failure 500 {object} models.Error "Internal error" @Router /project/{project}/stage/{stage}/service [get]

type ServiceParamsValidator

type ServiceParamsValidator struct {
	ServiceNameMaxSize int
}

func (ServiceParamsValidator) Validate

func (s ServiceParamsValidator) Validate(params interface{}) error

type StageHandler

type StageHandler struct {
	StageManager IStageManager
}

func NewStageHandler

func NewStageHandler(stageManager IStageManager) *StageHandler

func (*StageHandler) GetAllStages

func (sh *StageHandler) GetAllStages(c *gin.Context)

GetAllStages godoc @Summary Get all stages of a project @Description Get the list of stages of a project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}stages:read</span> @Tags Stage @Security ApiKeyAuth @Accept json @Produce json @Param project path string true "The name of the project" @Param pageSize query int false "The number of items to return" @Param nextPageKey query string false "Pointer to the next set of items" @Param disableUpstreamSync query boolean false "Disable sync of upstream repo before reading content" @Success 200 {object} apimodels.ExpandedStages "ok" @Failure 400 {object} models.Error "Invalid payload" @Failure 404 {object} models.Error "Not found" @Failure 500 {object} models.Error "Internal error" @Router /project/{project}/stage [get]

func (*StageHandler) GetStage

func (sh *StageHandler) GetStage(c *gin.Context)

GetStage godoc @Summary Get a stage @Description Get a stage of a project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}stages:read</span> @Tags Stage @Security ApiKeyAuth @Accept json @Produce json @Param project path string true "The name of the project" @Param stage path string true "The name of the stage" @Success 200 {object} apimodels.ExpandedStage "ok" @Failure 404 {object} models.Error "Not found" @Failure 500 {object} models.Error "Internal Error" @Router /project/{project}/stage/{stage} [get]

type StageManager

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

func NewStageManager

func NewStageManager(projectMVRepo db.ProjectMVRepo) *StageManager

func (*StageManager) GetAllStages

func (sm *StageManager) GetAllStages(projectName string) ([]*apimodels.ExpandedStage, error)

func (*StageManager) GetStage

func (sm *StageManager) GetStage(projectName, stageName string) (*apimodels.ExpandedStage, error)

type StateHandler

type StateHandler struct {
	StateRepo db.SequenceStateRepo
	// contains filtered or unexported fields
}

func NewStateHandler

func NewStateHandler(stateRepo db.SequenceStateRepo, shipyardController controller.IShipyardController) *StateHandler

func (*StateHandler) ControlSequenceState

func (sh *StateHandler) ControlSequenceState(c *gin.Context)

ControlSequenceState godoc @Summary Pause/Resume/Abort a task sequence @Description Pause/Resume/Abort a task sequence, either for a specific stage, or for all stages involved in the sequence @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}projects:write</span> @Tags Sequence @Security ApiKeyAuth @Accept json @Produce json @Param project path string true "The project name" @Param keptnContext path string true "The keptnContext ID of the sequence" @Param sequenceControl body apimodels.SequenceControlCommand true "Sequence Control Command" @Success 200 {object} apimodels.SequenceControlResponse "ok" @Failure 400 {object} models.Error "Invalid payload" @Failure 404 {object} models.Error "Not found" @Failure 500 {object} models.Error "Internal error" @Router /sequence/{project}/{keptnContext}/control [post]

func (*StateHandler) GetSequenceState

func (sh *StateHandler) GetSequenceState(c *gin.Context)

GetSequenceState godoc @Summary Get task sequence execution states @Description Get task sequence execution states @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}projects:read</span> @Tags Sequence @Security ApiKeyAuth @Accept json @Produce json @Param project path string false "The project name" @Param name query string false "The name of the sequence" @Param state query string false "The state of the sequence (e.g., triggered, finished,...)" @Param fromTime query string false "The from time stamp for fetching sequence states (in ISO8601 time format, e.g.: 2021-05-10T09:51:00.000Z)" @Param beforeTime query string false "The before time stamp for fetching sequence states (in ISO8601 time format, e.g.: 2021-05-10T09:51:00.000Z)" @Param pageSize query int false "The number of items to return" @Param nextPageKey query string false "Pointer to the next set of items" @Param keptnContext query string false "Comma separated list of keptnContext IDs" @Success 200 {object} apimodels.SequenceStates "ok" @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /sequence/{project} [get]

type UniformIntegrationHandler

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

func NewUniformIntegrationHandler

func NewUniformIntegrationHandler(uniformRepo db.UniformRepo) *UniformIntegrationHandler

func (*UniformIntegrationHandler) CreateSubscription

func (rh *UniformIntegrationHandler) CreateSubscription(c *gin.Context)

CreateSubscription creates a new subscription @Summary Create a new subscription @Description Create a new subscription @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}integrations:write</span> @Tags Uniform @Security ApiKeyAuth @Accept json @Produce json @Param integrationID path string true "integrationID" @Param subscription body apimodels.EventSubscription true "Subscription" @Success 201 @Failure 400 {object} models.Error "Invalid payload" @Failure 404 {object} models.Error "Not found" @Failure 500 {object} models.Error "Internal error" @Router /uniform/registration/{integrationID}/subscription [post]

func (*UniformIntegrationHandler) DeleteSubscription

func (rh *UniformIntegrationHandler) DeleteSubscription(c *gin.Context)

DeleteSubscription deletes a new subscription @Summary Delete a subscription @Description Delete a subscription @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}integrations:delete</span> @Tags Uniform @Security ApiKeyAuth @Accept json @Produce json @Param integrationID path string true "integrationID" @Param subscriptionID path string true "subscriptionID" @Success 200 @Failure 500 {object} models.Error "Internal error" @Router /uniform/registration/{integrationID}/subscription/{subscriptionID} [delete]

func (*UniformIntegrationHandler) GetRegistrations

func (rh *UniformIntegrationHandler) GetRegistrations(c *gin.Context)

GetRegistrations Retrieve uniform integrations matching the provided filter @Summary Retrieve uniform integrations matching the provided filter @Description Retrieve uniform integrations matching the provided filter @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}integrations:read</span> @Tags Uniform @Security ApiKeyAuth @Accept json @Produce json @Param id query string false "id" @Param name query string false "name" @Param project query string false "project" @Param stage query string false "stage" @Param service query string false "service" @Success 200 {object} []apimodels.Integration "ok" @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /uniform/registration [get]

func (*UniformIntegrationHandler) GetSubscription

func (rh *UniformIntegrationHandler) GetSubscription(c *gin.Context)

GetSubscription retrieves an already existing subscription @Summary Retrieve an already existing subscription @Description Retrieve an already existing subscription @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}integrations:read</span> @Tags Uniform @Security ApiKeyAuth @Accept json @Produce json @Param integrationID path string true "integrationID" @Param subscriptionID path string true "subscriptionID" @Success 200 {object} apimodels.EventSubscription "ok" @Failure 404 {object} models.Error "Not found" @Failure 500 {object} models.Error "Internal error" @Router /uniform/registration/{integrationID}/subscription/{subscriptionID} [get]

func (*UniformIntegrationHandler) GetSubscriptions

func (rh *UniformIntegrationHandler) GetSubscriptions(c *gin.Context)

GetSubscriptions retrieves all subscriptions of a uniform integration @Summary Retrieve all subscriptions of a uniform integration @Description Retrieve all subscriptions of a uniform integration @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}integrations:read</span> @Tags Uniform @Security ApiKeyAuth @Accept json @Produce json @Param integrationID path string true "integrationID" @Success 200 {object} []apimodels.EventSubscription "ok" @Failure 404 {object} models.Error "Not found" @Failure 500 {object} models.Error "Internal error" @Router /uniform/registration/{integrationID}/subscription [get]

func (*UniformIntegrationHandler) KeepAlive

func (rh *UniformIntegrationHandler) KeepAlive(c *gin.Context)

KeepAlive returns current registration data of an integration @Summary Endpoint for sending heartbeat messages sent from Keptn integrations to the control plane @Description Endpoint for sending heartbeat messages sent from Keptn integrations to the control plane @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}integrations:write</span> @Tags Uniform @Security ApiKeyAuth @Accept json @Produce json @Param integrationID path string true "integrationID" @Success 200 {object} apimodels.Integration "ok" @Failure 404 {object} models.Error "Not found" @Failure 500 {object} models.Error "Internal error" @Router /uniform/registration/{integrationID}/ping [PUT]

func (*UniformIntegrationHandler) Register

func (rh *UniformIntegrationHandler) Register(c *gin.Context)

Register creates or updates a uniform integration @Summary Register a uniform integration @Description Register a uniform integration @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}integrations:write</span> @Tags Uniform @Security ApiKeyAuth @Accept json @Produce json @Param integration body apimodels.Integration true "Integration" @Success 200 {object} models.RegisterResponse "ok: registration already exists" @Success 201 {object} models.RegisterResponse "ok: a new registration has been created" @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /uniform/registration [post]

func (*UniformIntegrationHandler) Unregister

func (rh *UniformIntegrationHandler) Unregister(c *gin.Context)

Unregister deletes a uniform integration @Summary Unregister a uniform integration @Description Unregister a uniform integration @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}integrations:delete</span> @Tags Uniform @Security ApiKeyAuth @Accept json @Produce json @Param integrationID path string true "integrationID" @Success 200 @Failure 500 {object} models.Error "Internal error" @Router /uniform/registration/{integrationID} [delete]

func (*UniformIntegrationHandler) UpdateSubscription

func (rh *UniformIntegrationHandler) UpdateSubscription(c *gin.Context)

UpdateSubscription updates or creates a subscription @Summary Update or create a subscription @Description Update or create a subscription @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}integrations:write</span> @Tags Uniform @Security ApiKeyAuth @Accept json @Produce json @Param integrationID path string true "integrationID" @Param subscriptionID path string true "subscriptionID" @Param subscription body apimodels.EventSubscription true "Subscription" @Success 201 @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /uniform/registration/{integrationID}/subscription/{subscriptionID} [put]

type UniformParamsValidator

type UniformParamsValidator struct {
	CheckProject bool
}

func (UniformParamsValidator) Validate

func (u UniformParamsValidator) Validate(params interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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