Documentation
¶
Index ¶
- func IllegalEmptyEnvironment() error
- func NoActiveDeploymentFoundInEnvironment(appName, envName string) error
- func NonExistingApplication(underlyingError error, appName string) error
- func NonExistingComponentName(appName, componentName string) error
- func NonExistingDeployment(underlyingError error, deploymentName string) error
- func NonExistingFromEnvironment(underlyingError error) error
- func NonExistingPod(appName, podName string) error
- func NonExistingToEnvironment(underlyingError error) error
- type Component
- type ComponentBuilder
- type ComponentStatus
- type ComponentSummary
- type ContainerStatus
- type Deployment
- type DeploymentBuilder
- type DeploymentSummary
- type HorizontalScalingSummary
- type Port
- type PromotionParameters
- type ReplicaStatus
- type ReplicaSummary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IllegalEmptyEnvironment ¶
func IllegalEmptyEnvironment() error
IllegalEmptyEnvironment From environment does not exist
func NoActiveDeploymentFoundInEnvironment ¶
NoActiveDeploymentFoundInEnvironment Deployment wasn't found
func NonExistingApplication ¶
NonExistingApplication No application found by name
func NonExistingComponentName ¶
NonExistingComponentName Component by name was not found
func NonExistingDeployment ¶
NonExistingDeployment Deployment wasn't found
func NonExistingFromEnvironment ¶
NonExistingFromEnvironment From environment does not exist
func NonExistingPod ¶
NonExistingPod Pod by name was not found
func NonExistingToEnvironment ¶
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 trigged 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"`
// 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"`
}
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
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"`
// 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"`
}
ReplicaSummary describes condition of a pod swagger:model ReplicaSummary