models

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: MIT Imports: 14 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 NonExistingDeployment

func NonExistingDeployment(underlyingError error, deploymentName string) error

NonExistingDeployment Deployment wasn't found

func NonExistingPod

func NonExistingPod(appName, podName string) error

NonExistingPod Pod by name was not found

Types

type AuxiliaryResource added in v1.19.2

type AuxiliaryResource struct {
	// OAuth2 describes the oauth2 resource
	//
	// required: false
	// - oauth: OAuth2 auxiliary resource
	OAuth2 *OAuth2AuxiliaryResource `json:"oauth2,omitempty"`
}

AuxiliaryResource describes an auxiliary resources for a component swagger:model AuxiliaryResource

type AuxiliaryResourceDeployment added in v1.19.2

type AuxiliaryResourceDeployment struct {
	// Status of the auxiliary resource's deployment
	// required: true
	// - Consistent: All replicas are running with the desired state
	// - Reconciling: Waiting for new replicas to enter desired state
	// - Stopped: Replica count is set to 0
	//
	// example: Consistent
	Status string `json:"status"`

	// Running replicas of the auxiliary resource's deployment
	//
	// required: false
	ReplicaList []ReplicaSummary `json:"replicaList"`
}

AuxiliaryResourceDeployment describes the state of the auxiliary resource's deployment swagger:model AuxiliaryResourceDeployment

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/app-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"`

	// Auxiliary resources for this component
	//
	// required: false
	AuxiliaryResource `json:",inline"`
}

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
	WithSchedulerPort(schedulerPort *int32) ComponentBuilder
	WithScheduledJobPayloadPath(scheduledJobPayloadPath string) ComponentBuilder
	WithRadixEnvironmentVariables(map[string]string) ComponentBuilder
	WithComponent(v1.RadixCommonDeployComponent) ComponentBuilder
	WithAuxiliaryResource(AuxiliaryResource) ComponentBuilder
	BuildComponentSummary() (*ComponentSummary, error)
	BuildComponent() (*Component, error)
}

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 ComponentStatusFromDeployment added in v1.19.2

func ComponentStatusFromDeployment(deployment *appsv1.Deployment) ComponentStatus

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/app-server:cdgkg
	Image string `json:"image"`
}

ComponentSummary describe a component part of a 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 (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

func (*Deployment) GetComponentByName added in v1.19.2

func (d *Deployment) GetComponentByName(name string) *Component

type DeploymentBuilder

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

DeploymentBuilder Builds DTOs

func NewDeploymentBuilder

func NewDeploymentBuilder() DeploymentBuilder

NewDeploymentBuilder Constructor for application deploymentBuilder

type DeploymentSummary

type DeploymentSummary struct {
	DeploymentSummaryPipelineJobInfo `json:",inline"`

	// Name the unique name of the Radix application deployment
	//
	// required: true
	// example: radix-canary-golang-tzbqi
	Name string `json:"name"`

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

	// ActiveFrom Timestamp when the deployment starts (or created)
	//
	// required: true
	// 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 DeploymentSummaryPipelineJobInfo added in v1.14.2

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

	// Type of pipeline job
	//
	// required: false
	// example: build-deploy
	PipelineJobType string `json:"pipelineJobType,omitempty"`

	// Name of the environment the deployment was promoted from
	// Applies only for pipeline jobs of type 'promote'
	//
	// required: false
	// example: qa
	PromotedFromEnvironment string `json:"promotedFromEnvironment,omitempty"`

	// CommitID the commit ID of the branch to build
	//
	// required: false
	// example: 4faca8595c5283a9d0f17a623b9255a0d9866a2e
	CommitID string `json:"commitID,omitempty"`
}

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 OAuth2AuxiliaryResource added in v1.19.2

type OAuth2AuxiliaryResource struct {
	// Deployment describes the underlying Kubernetes deployment for the resource
	//
	// required: true
	Deployment AuxiliaryResourceDeployment `json:"deployment,omitempty"`
}

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 a port of a component 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"`

	// The image the container is running.
	//
	// required: false
	// example: radixdev.azurecr.io/app-server:cdgkg
	Image string `json:"image"`

	// ImageID of the container's image.
	//
	// required: false
	// example: radixdev.azurecr.io/app-server@sha256:d40cda01916ef63da3607c03785efabc56eb2fc2e0dab0726b1a843e9ded093f
	ImageId string `json:"imageId"`
}

ReplicaSummary describes condition of a pod swagger:model ReplicaSummary

func GetReplicaSummary added in v1.9.0

func GetReplicaSummary(pod corev1.Pod) ReplicaSummary

type ScheduledBatchSummary added in v1.20.0

type ScheduledBatchSummary struct {
	// Name of the scheduled batch
	//
	// required: true
	// example: batch-20181029135644-algpv-6hznh
	Name string `json:"name"`

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

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

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

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

	// Message of a status, if any, of the job
	//
	// required: false
	// example: "Error occurred"
	Message string `json:"message,omitempty"`

	// ReplicaSummary
	//
	// required: false
	Replica *ReplicaSummary `json:"replica,omitempty"`

	// TotalJobCount count of jobs, requested to be scheduled by a batch
	//
	// required: true
	// example: 5
	TotalJobCount int `json:"totalJobCount"`

	// Jobs within the batch of ScheduledJobSummary
	//
	// required: false
	JobList []ScheduledJobSummary `json:"jobList,omitempty"`
}

ScheduledBatchSummary holds information about scheduled batch swagger:model ScheduledBatchSummary

func (*ScheduledBatchSummary) GetCreated added in v1.20.0

func (job *ScheduledBatchSummary) GetCreated() string

func (*ScheduledBatchSummary) GetEnded added in v1.20.0

func (job *ScheduledBatchSummary) GetEnded() string

func (*ScheduledBatchSummary) GetStarted added in v1.20.0

func (job *ScheduledBatchSummary) GetStarted() string

func (*ScheduledBatchSummary) GetStatus added in v1.20.0

func (job *ScheduledBatchSummary) GetStatus() string

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,omitempty"`

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

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

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

	// Message of a status, if any, of the job
	//
	// required: false
	// example: "Error occurred"
	Message string `json:"message,omitempty"`

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

	// JobId JobId, if any
	//
	// required: false
	// example: "job1"
	JobId string `json:"jobId,omitempty"`

	// BatchName Batch name, if any
	//
	// required: false
	// example: "batch-abc"
	BatchName string `json:"batchName,omitempty"`
}

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