deploymentplan

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddDeploymentRequest

type AddDeploymentRequest struct {
	Metadata           core.Metadata
	DeploymentID       string
	PayloadCoordinates []PayloadCoordinates
	InstanceCount      uint32
}

type Application

type Application struct {
	PayloadName       string
	Resources         ApplicationResources
	Ports             []ApplicationPort
	PersistentVolumes []ApplicationPersistentVolume
}

type ApplicationPersistentVolume

type ApplicationPersistentVolume struct {
	StorageClass string
	Capacity     uint32
	MountPath    string
}

type ApplicationPort

type ApplicationPort struct {
	Protocol string
	Port     uint32
}

type ApplicationResources

type ApplicationResources struct {
	Cores  uint32
	Memory uint32
}

type ComparatorType

type ComparatorType string
const (
	ComparatorTypeIn    ComparatorType = "ComparatorType_IN"
	ComparatorTypeNotIn ComparatorType = "ComparatorType_NOT_IN"
	ComparatorTypeGte   ComparatorType = "ComparatorType_GTE"
	ComparatorTypeLte   ComparatorType = "ComparatorType_LTE"
)

type CreateRequest

type CreateRequest struct {
	Name                        string
	Namespace                   string                      // Namespace is the namespace of the Deployment.
	ServiceName                 string                      // ServiceName is the name of the service associated with the Deployment. Certs will be issued for this service.
	MatchingComputeCapabilities []MatchingComputeCapability // MatchingCapabilities is a list of capabilities that the Deployment requires.
	Applications                []Application               // Applications is a list of applications that the Deployment requires.
}

CreateRequest represents the Deployment creation request.

type CreateResponse

type CreateResponse struct {
	Record DeploymentPlanRecord
}

CreateResponse represents the response after creating a new Deployment.

type DeleteRequest

type DeleteRequest struct {
	Metadata core.Metadata
}

type Deployment

type Deployment struct {
	ID                 string               // ID is the ID of the DeploymentPlan.
	Status             DeploymentStatus     // Status is the status of the Deployment.
	PayloadCoordinates []PayloadCoordinates // PayloadCoordinates is a list of coordinates for the payloads that the Deployment requires.
	InstanceCount      uint32               // InstanceCount is the number of instances of the Deployment.
}

type DeploymentPlanListFilters

type DeploymentPlanListFilters struct {
	IDIn          []string // IN condition
	NameIn        []string // IN condition
	VersionGte    *uint64  // Greater than or equal condition
	VersionLte    *uint64  // Less than or equal condition
	VersionEq     *uint64  // Equal condition
	PayloadNameIn []string // IN condition
	ServiceNameIn []string // IN condition

	DeploymentPlanIDIn     []string // IN condition
	DeploymentPlanStatusIn []DeploymentState

	IncludeDeleted bool   // IncludeDeleted indicates whether to include soft-deleted records in the result.
	Limit          uint32 // Limit is the maximum number of records to return.

	StateIn    []DeploymentPlanState
	StateNotIn []DeploymentPlanState
}

DeploymentFilters contains filters for querying the Deployment table.

type DeploymentPlanRecord

type DeploymentPlanRecord struct {
	Metadata core.Metadata        // Metadata is the metadata that identifies the Deployment. It is a combination of the Deployment's name and version.
	Name     string               // Name is the name for this Deployment.
	Status   DeploymentPlanStatus // Status is the status of the Deployment.

	Namespace                   string                      // Namespace is the namespace of the Deployment.
	ServiceName                 string                      // ServiceName is the name of the service associated with the Deployment. Certs will be issued for this service.
	MatchingComputeCapabilities []MatchingComputeCapability // MatchingCapabilities is a list of capabilities that the Deployment requires.
	Applications                []Application               // Applications is a list of applications that the Deployment requires.

	Deployments []Deployment // Deployment is an instantiation of the DeploymentPlan.
}

Deployment is a representation of a workload which is expected to be deployed.

type DeploymentPlanState

type DeploymentPlanState string

DeploymentPlanState is the state of a Deployment.

const (
	DeploymentPlanStateUnknown  DeploymentPlanState = "DeploymentPlanState_UNKNOWN"
	DeploymentPlanStateActive   DeploymentPlanState = "DeploymentPlanState_ACTIVE"
	DeploymentPlanStateInactive DeploymentPlanState = "DeploymentPlanState_INACTIVE"
)

type DeploymentPlanStatus

type DeploymentPlanStatus struct {
	State   DeploymentPlanState // State is the discrete condition of the resource.
	Message string              // Message is a human-readable description of the resource's state.
}

type DeploymentState

type DeploymentState string

DeploymentState is the state of a Deployment.

const (
	DeploymentStateUnknown    DeploymentState = "DeploymentState_UNKNOWN"
	DeploymentStatePending    DeploymentState = "DeploymentState_PENDING"
	DeploymentStateInProgress DeploymentState = "DeploymentState_IN_PROGRESS"
	DeploymentStateCancelled  DeploymentState = "DeploymentState_CANCELLED"
	DeploymentStateFailed     DeploymentState = "DeploymentState_FAILED"
	DeploymentStatePaused     DeploymentState = "DeploymentState_PAUSED"
	DeploymentStateCompleted  DeploymentState = "DeploymentState_COMPLETED"
)

type DeploymentStatus

type DeploymentStatus struct {
	State   DeploymentState // State is the discrete condition of the resource.
	Message string          // Message is a human-readable description of the resource's state.
}

type GetResponse

type GetResponse struct {
	Record DeploymentPlanRecord
}

GetResponse represents the response for fetching a Deployment.

type Ledger

type Ledger interface {
	// Create creates a new Deployment.
	Create(context.Context, *CreateRequest) (*CreateResponse, error)
	// GetByID retrieves a Deployment by its ID.
	GetByID(context.Context, string) (*GetResponse, error)
	// GetByName retrieves a Deployment by its name.
	GetByName(context.Context, string) (*GetResponse, error)
	// UpdateStatus updates the state and message of an existing Deployment.
	UpdateStatus(context.Context, *UpdateStatusRequest) (*UpdateResponse, error)
	// List returns a list of Deployment that match the provided filters.
	List(context.Context, *ListRequest) (*ListResponse, error)
	// Delete soft-deletes a Deployment.
	Delete(context.Context, *DeleteRequest) error

	AddDeployment(context.Context, *AddDeploymentRequest) (*UpdateResponse, error)
	UpdateDeploymentStatus(context.Context, *UpdateDeploymentStatusRequest) (*UpdateResponse, error)
}

Ledger provides the methods for managing Deployment records.

func NewLedger

func NewLedger(repo Repository) Ledger

NewLedger creates a new Ledger instance.

type ListRequest

type ListRequest struct {
	Filters DeploymentPlanListFilters
}

ListRequest represents the request to list Deployments with filters.

type ListResponse

type ListResponse struct {
	Records []DeploymentPlanRecord
}

ListResponse represents the response to a list request.

type MatchingComputeCapability

type MatchingComputeCapability struct {
	CapabilityType  string
	Comparator      ComparatorType
	CapabilityNames []string
}

type PayloadCoordinates

type PayloadCoordinates struct {
	PayloadName string
	Coordinates map[string]string
}

type Repository

Repository provides the methods that the storage layer must implement to support the ledger.

type UpdateDeploymentStatusRequest

type UpdateDeploymentStatusRequest struct {
	Metadata     core.Metadata
	DeploymentID string
	Status       DeploymentStatus
}

type UpdateResponse

type UpdateResponse struct {
	Record DeploymentPlanRecord
}

UpdateResponse represents the response after updating the state of a Deployment.

type UpdateStatusRequest

type UpdateStatusRequest struct {
	Metadata core.Metadata
	Status   DeploymentPlanStatus
}

UpdateStatusRequest represents the request to update the state and message of a Deployment.

Jump to

Keyboard shortcuts

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