models

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IllegalEmptyEnvironment

func IllegalEmptyEnvironment() error

IllegalEmptyEnvironment From environment does not exist

func NoActiveDeploymentFoundInEnvironment

func NoActiveDeploymentFoundInEnvironment(appName, envName string) error

NoActiveDeploymentFoundInEnvironment Deployment wasn't found

func NonExistingApplication

func NonExistingApplication(underlyingError error, appName string) error

NonExistingApplication No application found by name

func NonExistingComponentName

func NonExistingComponentName(appName, componentName string) error

NonExistingComponentName Component by name was not found

func NonExistingDeployment

func NonExistingDeployment(underlyingError error, deploymentName string) error

NonExistingDeployment Deployment wasn't found

func NonExistingFromEnvironment

func NonExistingFromEnvironment(underlyingError error) error

NonExistingFromEnvironment From environment does not exist

func NonExistingPod

func NonExistingPod(appName, podName string) error

NonExistingPod Pod by name was not found

func NonExistingToEnvironment

func NonExistingToEnvironment(underlyingError error) error

NonExistingToEnvironment To environment does not exist

Types

type Component

type Component struct {
	// Name the component
	//
	// required: true
	// example: server
	Name string `json:"name"`

	// Type of component
	//
	// required: true
	// example: component
	Type string `json:"type"`

	// Status of the component
	// required: false
	// - Stopped = Component is stopped (no replica)
	// - Consistent = Component is consistent with config
	// - Restarting = User has triggered restart, but this is not reconciled
	//
	// example: Consistent
	Status string `json:"status"`

	// Image name
	//
	// required: true
	// example: radixdev.azurecr.io/radix-api-server:cdgkg
	Image string `json:"image"`

	// Ports defines the port number and protocol that a component is exposed for internally in environment
	//
	// required: false
	// type: "array"
	// items:
	//    "$ref": "#/definitions/Port"
	Ports []Port `json:"ports"`

	// SchedulerPort defines the port number that a Job Scheduler is exposed internally in environment
	//
	// required: false
	// example: 8080
	SchedulerPort *int32 `json:"schedulerPort,omitempty"`

	// ScheduledJobPayloadPath defines the payload path, where payload for Job Scheduler will be mapped as a file. From radixconfig.yaml
	//
	// required: false
	// example: "/tmp/payload"
	ScheduledJobPayloadPath string `json:"scheduledJobPayloadPath,omitempty"`

	// Component secret names. From radixconfig.yaml
	//
	// required: false
	// example: DB_CON,A_SECRET
	Secrets []string `json:"secrets"`

	// Variable names map to values. From radixconfig.yaml
	//
	// required: false
	Variables map[string]string `json:"variables"`

	// Array of pod names
	//
	// required: false
	// deprecated: true
	// example: server-78fc8857c4-hm76l,server-78fc8857c4-asfa2
	// Deprecated: Use ReplicaList instead.
	Replicas []string `json:"replicas"`

	// Array of ReplicaSummary
	//
	// required: false
	ReplicaList []ReplicaSummary `json:"replicaList"`

	// HorizontalScaling defines horizontal scaling summary for this component
	//
	// required: false
	HorizontalScalingSummary *HorizontalScalingSummary `json:"horizontalScalingSummary"`

	// Array of ScheduledJobList
	//
	// required: false
	ScheduledJobList []ScheduledJobSummary `json:"scheduledJobList"`
}

Component describe an component part of an deployment swagger:model Component

type ComponentBuilder

type ComponentBuilder interface {
	WithStatus(ComponentStatus) ComponentBuilder
	WithPodNames([]string) ComponentBuilder
	WithReplicaSummaryList([]ReplicaSummary) ComponentBuilder
	WithScheduledJobSummaryList([]ScheduledJobSummary) ComponentBuilder
	WithSchedulerPort(schedulerPort *int32) ComponentBuilder
	WithScheduledJobPayloadPath(scheduledJobPayloadPath string) ComponentBuilder
	WithRadixEnvironmentVariables(map[string]string) ComponentBuilder
	WithComponent(v1.RadixCommonDeployComponent) ComponentBuilder
	BuildComponentSummary() *ComponentSummary
	BuildComponent() *Component
}

ComponentBuilder Builds DTOs

func NewComponentBuilder

func NewComponentBuilder() ComponentBuilder

NewComponentBuilder Constructor for application component

type ComponentStatus

type ComponentStatus int

ComponentStatus Enumeration of the statuses of component

const (
	// StoppedComponent stopped component
	StoppedComponent ComponentStatus = iota

	// ConsistentComponent consistent component
	ConsistentComponent

	// ComponentReconciling Component reconciling
	ComponentReconciling

	// ComponentRestarting restarting component
	ComponentRestarting

	// ComponentOutdated has outdated image
	ComponentOutdated
)

func GetComponentStatusFromName

func GetComponentStatusFromName(name string) (ComponentStatus, error)

GetComponentStatusFromName Gets status from name

func (ComponentStatus) String

func (p ComponentStatus) String() string

type ComponentSummary

type ComponentSummary struct {
	// Name the component
	//
	// required: true
	// example: server
	Name string `json:"name"`

	// Type of component
	//
	// required: true
	// example: component
	Type string `json:"type"`

	// Image name
	//
	// required: true
	// example: radixdev.azurecr.io/radix-api-server:cdgkg
	Image string `json:"image"`
}

ComponentSummary describe an component part of an deployment swagger:model ComponentSummary

type ContainerStatus

type ContainerStatus int

ContainerStatus Enumeration of the statuses of container

const (
	// Pending container
	Pending ContainerStatus = iota

	// Failing container
	Failing

	// Running container
	Running

	// Terminated container
	Terminated

	// Starting container
	Starting
)

func GetStatusFromName

func GetStatusFromName(name string) (ContainerStatus, error)

GetStatusFromName Gets status from name

func (ContainerStatus) String

func (p ContainerStatus) String() string

type Deployment

type Deployment struct {
	// Name the unique name of the Radix application deployment
	//
	// required: false
	// example: radix-canary-golang-tzbqi
	Name string `json:"name"`

	// Array of components
	//
	// required: false
	Components []*Component `json:"components,omitempty"`

	// Name of job creating deployment
	//
	// required: false
	CreatedByJob string `json:"createdByJob,omitempty"`

	// Environment the environment this Radix application deployment runs in
	//
	// required: false
	// example: prod
	Environment string `json:"environment"`

	// ActiveFrom Timestamp when the deployment starts (or created)
	//
	// required: false
	// example: 2006-01-02T15:04:05Z
	ActiveFrom string `json:"activeFrom"`

	// ActiveTo Timestamp when the deployment ends
	//
	// required: false
	// example: 2006-01-02T15:04:05Z
	ActiveTo string `json:"activeTo,omitempty"`
}

Deployment describe an deployment swagger:model Deployment

type DeploymentBuilder

type DeploymentBuilder interface {
	WithRadixDeployment(v1.RadixDeployment) DeploymentBuilder
	WithName(string) DeploymentBuilder
	WithAppName(string) DeploymentBuilder
	WithEnvironment(string) DeploymentBuilder
	WithActiveFrom(time.Time) DeploymentBuilder
	WithActiveTo(time.Time) DeploymentBuilder
	WithJobName(string) DeploymentBuilder
	WithComponents(components []*Component) DeploymentBuilder
	BuildDeploymentSummary() *DeploymentSummary
	BuildDeployment() *Deployment
}

DeploymentBuilder Builds DTOs

func NewDeploymentBuilder

func NewDeploymentBuilder() DeploymentBuilder

NewDeploymentBuilder Constructor for application deploymentBuilder

type DeploymentSummary

type DeploymentSummary struct {
	// Name the unique name of the Radix application deployment
	//
	// required: false
	// example: radix-canary-golang-tzbqi
	Name string `json:"name"`

	// Name of job creating deployment
	//
	// required: false
	CreatedByJob string `json:"createdByJob,omitempty"`

	// Environment the environment this Radix application deployment runs in
	//
	// required: false
	// example: prod
	Environment string `json:"environment"`

	// ActiveFrom Timestamp when the deployment starts (or created)
	//
	// required: false
	// example: 2006-01-02T15:04:05Z
	ActiveFrom string `json:"activeFrom"`

	// ActiveTo Timestamp when the deployment ends
	//
	// required: false
	// example: 2006-01-02T15:04:05Z
	ActiveTo string `json:"activeTo,omitempty"`
}

DeploymentSummary describe an deployment swagger:model DeploymentSummary

type HorizontalScalingSummary

type HorizontalScalingSummary struct {
	// Component minimum replicas. From radixconfig.yaml
	//
	// required: false
	// example: 2
	MinReplicas int32 `json:"minReplicas"`

	// Component maximum replicas. From radixconfig.yaml
	//
	// required: false
	// example: 5
	MaxReplicas int32 `json:"maxReplicas"`

	// Component current average CPU utilization over all pods, represented as a percentage of requested CPU
	//
	// required: false
	// example: 70
	CurrentCPUUtilizationPercentage int32 `json:"currentCPUUtilizationPercentage"`

	// Component target average CPU utilization over all pods
	//
	// required: false
	// example: 80
	TargetCPUUtilizationPercentage int32 `json:"targetCPUUtilizationPercentage"`
}

HorizontalScalingSummary describe the summary of horizontal scaling of a component swagger:model HorizontalScalingSummary

type Port

type Port struct {
	// Component port name. From radixconfig.yaml
	//
	// required: true
	// example: http
	Name string `json:"name"`

	// Component port number. From radixconfig.yaml
	//
	// required: false
	// example: 8080
	Port int32 `json:"port"`
}

Port describe an component part of an deployment swagger:model Port

type PromotionParameters

type PromotionParameters struct {
	// FromEnvironment the environment to promote from
	//
	// required: true
	// example: dev
	FromEnvironment string `json:"fromEnvironment"`

	// ToEnvironment the environment to promote to
	//
	// required: true
	// example: prod
	ToEnvironment string `json:"toEnvironment"`
}

PromotionParameters describe environment to promote from and to swagger:model PromotionParameters

type ReplicaStatus

type ReplicaStatus struct {
	// Status of the container
	// - Pending = Container in Waiting state and the reason is ContainerCreating
	// - Failing = Container in Waiting state and the reason is anything else but ContainerCreating
	// - Running = Container in Running state
	// - Terminated = Container in Terminated state
	//
	// Enum: Pending,Failing,Running,Terminated
	// required: true
	// example: Pending, Failing, Running, Terminated, Starting
	Status string `json:"status"`
}

ReplicaStatus describes the status of a component container inside a pod swagger:model ReplicaStatus

type ReplicaSummary

type ReplicaSummary struct {
	// Pod name
	//
	// required: true
	// example: server-78fc8857c4-hm76l
	Name string `json:"name"`

	// Created timestamp
	//
	// required: false
	// example: 2006-01-02T15:04:05Z
	Created string `json:"created"`

	// Status describes the component container status
	//
	// required: false
	Status ReplicaStatus `json:"replicaStatus"`

	// StatusMessage provides message describing the status of a component container inside a pod
	//
	// required: false
	StatusMessage string `json:"statusMessage"`

	// RestartCount count of restarts of a component container inside a pod
	//
	// required: false
	RestartCount int32 `json:"restartCount"`
}

ReplicaSummary describes condition of a pod swagger:model ReplicaSummary

func GetReplicaSummary added in v1.9.0

func GetReplicaSummary(pod corev1.Pod) ReplicaSummary

type ScheduledJobSummary added in v1.9.0

type ScheduledJobSummary struct {
	// Name of the scheduled job
	//
	// required: false
	// example: job-component-20181029135644-algpv-6hznh
	Name string `json:"name"`

	// Created timestamp
	//
	// required: false
	// example: 2006-01-02T15:04:05Z
	Created string `json:"created"`

	// Started timestamp
	//
	// required: false
	// example: 2006-01-02T15:04:05Z
	Started string `json:"started"`

	// Ended timestamp
	//
	// required: false
	// example: 2006-01-02T15:04:05Z
	Ended string `json:"ended"`

	// Status of the job
	//
	// required: false
	// Enum: Waiting,Running,Succeeded,Stopping,Stopped,Failed
	// example: Waiting
	Status string `json:"status"`

	// Array of ReplicaSummary
	//
	// required: false
	ReplicaList []ReplicaSummary `json:"replicaList"`
}

ScheduledJobSummary holds general information about scheduled job swagger:model ScheduledJobSummary

func (*ScheduledJobSummary) GetCreated added in v1.9.0

func (job *ScheduledJobSummary) GetCreated() string

func (*ScheduledJobSummary) GetEnded added in v1.9.0

func (job *ScheduledJobSummary) GetEnded() string

func (*ScheduledJobSummary) GetStarted added in v1.9.0

func (job *ScheduledJobSummary) GetStarted() string

func (*ScheduledJobSummary) GetStatus added in v1.9.0

func (job *ScheduledJobSummary) GetStatus() string

Jump to

Keyboard shortcuts

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