deployments

package
v0.0.0-...-e28bd7b Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPBuildToService

func HTTPBuildToService(httpBuild hm.DeploymentBuild) interface{}

HTTPBuildToService converts the HTTP representation of deployment build to service TODO deployment build

func HTTPParametersToServiceParameterValues

func HTTPParametersToServiceParameterValues(meta service.TemplateMetadata, httpParameters []hm.KeyValue) (service.DeploymentParameterValues, error)

HTTPParametersToServiceParameterValues converts the HTTP representation of parameters to service representation of parameter values. In addition to basic conversion, this function will perform basic (non-comprehensive) checks on the parameter values. The point of validation here is not to provide comprehensive parameter validation, but to toss out some bad value as early as possible, downstream services (deployment) should still do complete validation, since api-service is not the only entry point for creating a run.

func HTTPResourceToService

func HTTPResourceToService(resource hm.DeploymentResource) service.DeploymentResource

HTTPResourceToService converts the HTTP representation of resource to service

func HTTPStateViewToService

func HTTPStateViewToService(httpView hm.DeploymentStateView) service.DeploymentStateView

HTTPStateViewToService converts the HTTP representation of state view to service

func ServiceBuildToHTTP

func ServiceBuildToHTTP(svcBuild interface{}) hm.DeploymentBuild

ServiceBuildToHTTP converts the service representation of deployment build to HTTP TODO deployment build

func ServiceDeploymentToHTTP

func ServiceDeploymentToHTTP(svcDeployment service.Deployment) hm.Deployment

ServiceDeploymentToHTTP converts the service representation of deployment to HTTP

func ServiceParametersToHTTP

func ServiceParametersToHTTP(svcParameters []service.DeploymentParameter) []hm.KeyValue

ServiceParametersToHTTP converts the service representation of parameters to HTTP

func ServiceResourceToHTTP

func ServiceResourceToHTTP(resource service.DeploymentResource) hm.DeploymentResource

ServiceResourceToHTTP converts the service representation of resource to HTTP

func ServiceRunToHTTP

func ServiceRunToHTTP(svcRun service.DeploymentRun) hm.DeploymentRun

ServiceRunToHTTP converts the service representation of deployment run to HTTP

func ServiceStateViewToHTTP

func ServiceStateViewToHTTP(svcView service.DeploymentStateView) hm.DeploymentStateView

ServiceStateViewToHTTP converts the service representation of state view to HTTP

Types

type Client

type Client interface {
	Session(actor, emulator string, isAdmin bool) (Session, error)
}

Client is an interface for interacting with the Deployments microservice. Implementations of this interface should encapsulate information necessary to interact with the microservice, such as Nats and Stan connection information.

func New

New creates a new Deployments microservice client.

type ListOption

type ListOption struct {
	WorkspaceID      cacaocommon.ID
	CurrentStatus    string
	AllCurrentStatus bool
	Offset           int
	PageSize         int
	// Return full run object for the current run
	FullRun bool
}

ListOption is options for listing deployments

type Session

type Session interface {
	ListDeployments(option ListOption) ([]hm.Deployment, error)
	SearchDeployments(option service.DeploymentListOption) ([]hm.Deployment, error)
	ValidateDeploymentCreationRequest(creationRequest *hm.Deployment) error
	AddDeployment(creationRequest *hm.Deployment) (cacaocommon.ID, error)
	GetDeployment(deploymentID cacaocommon.ID) (hm.Deployment, error)
	ValidateDeploymentUpdateRequest(deploymentID cacaocommon.ID, deployment *hm.DeploymentUpdate) error
	UpdateDeployment(deploymentID cacaocommon.ID, deployment *hm.DeploymentUpdate) (cacaocommon.ID, error)
	ValidateDeploymentDeletionRequest(deploymentID cacaocommon.ID) error
	DeleteDeployment(deploymentID cacaocommon.ID) (cacaocommon.ID, bool, error)
	ListDeploymentBuilds(deploymentID cacaocommon.ID) ([]hm.DeploymentBuild, error)
	ValidateDeploymentRebuildRequest(deploymentID cacaocommon.ID, params *hm.Parameters) error
	RebuildDeployment(deploymentID cacaocommon.ID, params *hm.Parameters) (cacaocommon.ID, error)
	GetDeploymentBuild(deploymentID, buildID cacaocommon.ID) (hm.DeploymentBuild, error)
	ListDeploymentRuns(deploymentID cacaocommon.ID) ([]hm.DeploymentRun, error)
	ValidateDeploymentRunRequest(deploymentID cacaocommon.ID, runRequest *hm.DeploymentRun) error
	RunDeployment(deploymentID cacaocommon.ID, runRequest *hm.DeploymentRun) (cacaocommon.ID, error)
	GetDeploymentRun(deploymentID, runID cacaocommon.ID) (hm.DeploymentRun, error)
	GetDeploymentLogsLocations(deploymentID cacaocommon.ID) ([]service.LogsLocation, error)
	GetDeploymentRunLogsLocations(deploymentID, runID cacaocommon.ID) ([]service.LogsLocation, error)
}

Session is an interface for interacting with the Deployments microservice on behalf of a user. The purpose of having a session is to consolidate parameters that are common in all or most requests, but are not known at configuration time.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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