models

package
v1.116.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppNameAndBranchAreRequiredForStartingPipeline

func AppNameAndBranchAreRequiredForStartingPipeline() error

AppNameAndBranchAreRequiredForStartingPipeline Cannot start pipeline when appname and branch are missing

func EnvironmentNotMappedToBranch

func EnvironmentNotMappedToBranch(envName, branch string) error

EnvironmentNotMappedToBranch Triggering a pipeline on an environment, not matched to a branch

func MatchAll

func MatchAll(rr *v1.RadixRegistration) bool

MatchAll returns a ApplicationMatch that always returns true

func OnePartOfDeployKeyIsNotAllowed

func OnePartOfDeployKeyIsNotAllowed() error

OnePartOfDeployKeyIsNotAllowed Error message

func UnmatchedBranchToEnvironment

func UnmatchedBranchToEnvironment(branch string) error

UnmatchedBranchToEnvironment Triggering a pipeline on an un-mapped branch is not allowed

func UserNotAllowedToTriggerPipelineError

func UserNotAllowedToTriggerPipelineError(appName string) error

UserNotAllowedToTriggerPipelineError Triggering a pipeline is not allowed for this user and app

Types

type Application

type Application struct {
	// Name the name of the application
	//
	// required: true
	// example: radix-canary-golang
	Name string `json:"name"`

	// Registration registration details
	//
	// required: true
	Registration ApplicationRegistration `json:"registration"`

	// Environments List of environments for this application
	//
	// required: false
	Environments []*environmentModels.EnvironmentSummary `json:"environments"`

	// Jobs list of run jobs for the application
	//
	// required: false
	Jobs []*jobModels.JobSummary `json:"jobs"`

	// DNS aliases showing nicer endpoint for application, without "app." subdomain domain
	//
	// required: false
	DNSAliases []DNSAlias `json:"dnsAliases,omitempty"`

	// List of external DNS names and which component and environment incoming requests shall be routed to.
	//
	// required: false
	DNSExternalAliases []DNSExternalAlias `json:"dnsExternalAliases,omitempty"`

	// App alias showing nicer endpoint for application
	//
	// required: false
	AppAlias *ApplicationAlias `json:"appAlias,omitempty"`

	// UserIsAdmin if user is member of application's admin groups
	//
	// required: true
	UserIsAdmin bool `json:"userIsAdmin"`

	// UseBuildKit if buildkit is used for building the application
	//
	// required: true
	UseBuildKit bool `json:"useBuildKit"`

	// UseBuildCache if build cache is used for building the application. Applicable when UseBuildKit is true. Default is true.
	//
	// required: true
	UseBuildCache bool `json:"useBuildCache"`
}

Application details of an application swagger:model Application

type ApplicationAlias

type ApplicationAlias struct {
	// URL the public endpoint
	//
	// required: true
	// example: https://my-app.app.radix.equinor.com
	URL string `json:"url"`

	// ComponentName the component exposing the endpoint
	//
	// required: true
	// example: frontend
	ComponentName string `json:"componentName"`

	// EnvironmentName the environment hosting the endpoint
	//
	// required: true
	// example: prod
	EnvironmentName string `json:"environmentName"`
}

ApplicationAlias holds public alias information swagger:model ApplicationAlias

type ApplicationMatch

type ApplicationMatch func(rr *v1.RadixRegistration) bool

ApplicationMatch defines a match function that takes a RadixRegistration as parameter and returns a bool indicating if the RR matched the filter or not

func MatchByNamesFunc

func MatchByNamesFunc(names []string) ApplicationMatch

MatchByNamesFunc returns a ApplicationMatch that checks if the name of a RadixRegistration matches one of the supplied names

func MatchBySSHRepoFunc

func MatchBySSHRepoFunc(sshRepo string) ApplicationMatch

MatchByNamesFunc returns a ApplicationMatch that checks if the CloneURL of a RadixRegistration matches sshRepo argument

type ApplicationRegistration

type ApplicationRegistration struct {
	// Name the unique name of the Radix application
	//
	// required: true
	// example: radix-canary-golang
	Name string `json:"name"`

	// AppID the unique application ID, which is a ULID
	//
	// required: true
	// example: 01JZ5GSH4B388RYMRYZPNR0104
	AppID string `json:"appId"`

	// Repository the github repository
	//
	// required: true
	// example: https://github.com/equinor/radix-canary-golang
	Repository string `json:"repository"`

	// SharedSecret the shared secret of the webhook
	//
	// required: true
	SharedSecret string `json:"sharedSecret"`

	// AdGroups the groups that should be able to access the application
	//
	// required: true
	AdGroups []string `json:"adGroups"`

	// AdUsers the users/service-principals that should be able to access the application
	//
	// required: true
	AdUsers []string `json:"adUsers"`

	// ReaderAdGroups the groups that should be able to read the application
	//
	// required: true
	ReaderAdGroups []string `json:"readerAdGroups"`

	// ReaderAdUsers the users/service-principals that should be able to read the application
	//
	// required: true
	ReaderAdUsers []string `json:"readerAdUsers"`

	// Owner of the application (email). Can be a single person or a shared group email
	//
	// required: true
	Owner string `json:"owner"`

	// Owner of the application (email). Can be a single person or a shared group email
	//
	// required: true
	Creator string `json:"creator"`

	// ConfigBranch information
	//
	// required: true
	ConfigBranch string `json:"configBranch"`

	// radixconfig.yaml file name and path, starting from the GitHub repository root (without leading slash)
	//
	// required: false
	RadixConfigFullName string `json:"radixConfigFullName,omitempty"`

	// ConfigurationItem is an identifier for an entity in a configuration management solution such as a CMDB.
	// ITIL defines a CI as any component that needs to be managed in order to deliver an IT Service
	// Ref: https://en.wikipedia.org/wiki/Configuration_item
	//
	// required: false
	ConfigurationItem string `json:"configurationItem"`
}

ApplicationRegistration describe an application swagger:model ApplicationRegistration

type ApplicationRegistrationBuilder

ApplicationRegistrationBuilder Handles construction of DTO

func NewApplicationRegistrationBuilder

func NewApplicationRegistrationBuilder() ApplicationRegistrationBuilder

NewApplicationRegistrationBuilder Constructor for application builder

type ApplicationRegistrationPatch

type ApplicationRegistrationPatch struct {
	// AdGroups the groups that should be able to access the application
	//
	// required: false
	AdGroups *[]string `json:"adGroups,omitempty"`

	// AdUsers the users/service-principals that should be able to access the application
	//
	// required: false
	AdUsers *[]string `json:"adUsers,omitempty"`

	// ReaderAdGroups the groups that should be able to read the application
	//
	// required: false
	ReaderAdGroups *[]string `json:"readerAdGroups,omitempty"`

	// ReaderAdUsers the users/service-principals that should be able to read the application
	//
	// required: false
	ReaderAdUsers *[]string `json:"readerAdUsers,omitempty"`

	// Owner of the application - should be an email
	//
	// required: false
	Owner *string `json:"owner,omitempty"`

	// Repository the github repository
	//
	// required: false
	Repository *string `json:"repository,omitempty"`

	// WBS information
	//
	// required: false
	WBS *string `json:"wbs,omitempty"`

	// ConfigBranch information
	//
	// required: false
	ConfigBranch *string `json:"configBranch,omitempty"`

	// radixconfig.yaml file name and path, starting from the GitHub repository root (without leading slash)
	//
	// required: false
	RadixConfigFullName string `json:"radixConfigFullName,omitempty"`

	// ConfigurationItem is an identifier for an entity in a configuration management solution such as a CMDB.
	// ITIL defines a CI as any component that needs to be managed in order to deliver an IT Service
	// Ref: https://en.wikipedia.org/wiki/Configuration_item
	//
	// required: false
	ConfigurationItem *string `json:"configurationItem"`
}

ApplicationRegistrationPatch contains fields that can be patched on a registration swagger:model ApplicationRegistrationPatch

type ApplicationRegistrationPatchRequest

type ApplicationRegistrationPatchRequest struct {
	// ApplicationRegistration
	//
	// required: true
	ApplicationRegistrationPatch *ApplicationRegistrationPatch `json:"applicationRegistrationPatch"`

	// AcknowledgeWarnings acknowledge all warnings
	//
	// required: false
	AcknowledgeWarnings bool `json:"acknowledgeWarnings,omitempty"`
}

ApplicationRegistrationPatchRequest contains request with fields that can be patched on a registration swagger:model ApplicationRegistrationPatchRequest

type ApplicationRegistrationRequest

type ApplicationRegistrationRequest struct {
	// ApplicationRegistration
	//
	// required: false
	ApplicationRegistration *ApplicationRegistration `json:"applicationRegistration"`

	// AcknowledgeWarnings acknowledge all warnings
	//
	// required: false
	AcknowledgeWarnings bool `json:"acknowledgeWarnings,omitempty"`
}

ApplicationRegistrationRequest describe a register application request swagger:model ApplicationRegistrationRequest

type ApplicationRegistrationUpsertResponse

type ApplicationRegistrationUpsertResponse struct {
	// ApplicationRegistration
	//
	// required: false
	ApplicationRegistration *ApplicationRegistration `json:"applicationRegistration"`

	// Warnings of upsert operation
	//
	// required: false
	// example: ["Repository is used in other application(s)"]
	Warnings []string `json:"warnings,omitempty"`
}

ApplicationRegistrationUpsertResponse describe an application upsert operation response swagger:model ApplicationRegistrationUpsertResponse

type ApplicationSearchIncludeFields

type ApplicationSearchIncludeFields struct {
	LatestJobSummary bool
	Environments     bool
}

type ApplicationSummary

type ApplicationSummary struct {
	// Name the name of the application
	//
	// required: true
	// example: radix-canary-golang
	Name string `json:"name"`

	// LatestJob The latest started job
	//
	// required: false
	LatestJob *jobModels.JobSummary `json:"latestJob,omitempty"`

	// Environments List of environments for this application
	//
	// required: false
	Environments []environmentmodels.Environment `json:"environments,omitempty"`
}

ApplicationSummary describe an application swagger:model ApplicationSummary

type ApplicationsSearchRequest

type ApplicationsSearchRequest struct {
	Names []string

	IncludeFields ApplicationSearchIncludeFields
}

type ComponentUtilization

type ComponentUtilization struct {
	Replicas map[string]ReplicaUtilization `json:"replicas"`
}

type DNSAlias

type DNSAlias struct {
	// URL the public endpoint
	//
	// required: true
	// example: https://my-app.radix.equinor.com
	URL string `json:"url"`

	// ComponentName the component exposing the endpoint
	//
	// required: true
	// example: frontend
	ComponentName string `json:"componentName"`

	// EnvironmentName the environment hosting the endpoint
	//
	// required: true
	// example: prod
	EnvironmentName string `json:"environmentName"`

	Status DNSAliasStatus `json:"status,omitempty"`
}

DNSAlias holds public DNS alias information swagger:model DNSAlias

type DNSAliasStatus

type DNSAliasStatus struct {
	Condition string `json:"condition,omitempty"`
	Message   string `json:"message,omitempty"`
}

DNSAliasStatus Status of the DNSAlias swagger:model DNSAliasStatus

type DNSExternalAlias

type DNSExternalAlias struct {
	// URL the public endpoint
	//
	// required: true
	// example: https://my-app.equinor.com
	URL string `json:"url"`

	// ComponentName the component exposing the endpoint
	//
	// required: true
	// example: frontend
	ComponentName string `json:"componentName"`

	// EnvironmentName the environment hosting the endpoint
	//
	// required: true
	// example: prod
	EnvironmentName string `json:"environmentName"`
}

DNSExternalAlias holds public external DNS alias information swagger:model DNSExternalAlias

type DeployKeyAndSecret

type DeployKeyAndSecret struct {
	// PublicDeployKey the public value of the deploy key
	//
	// required: true
	PublicDeployKey string `json:"publicDeployKey"`

	// SharedSecret the shared secret
	//
	// required: true
	SharedSecret string `json:"sharedSecret"`
}

DeployKeyAndSecret Holds generated public deploy key and shared secret swagger:model DeployKeyAndSecret

type EnvironmentUtilization

type EnvironmentUtilization struct {
	Components map[string]ComponentUtilization `json:"components"`
}

type PipelineParametersApplyConfig

type PipelineParametersApplyConfig struct {
	// TriggeredBy of the job - if empty will use user token upn (user principle name)
	//
	// example: a_user@equinor.com
	TriggeredBy string `json:"triggeredBy,omitempty"`

	// DeployExternalDNS deploy external DNS
	//
	// required: false
	// Extensions:
	// x-nullable: true
	DeployExternalDNS *bool `json:"deployExternalDNS,omitempty"`
}

PipelineParametersApplyConfig describes base info swagger:model PipelineParametersApplyConfig

func (PipelineParametersApplyConfig) MapPipelineParametersApplyConfigToJobParameter

func (param PipelineParametersApplyConfig) MapPipelineParametersApplyConfigToJobParameter() *jobModels.JobParameters

MapPipelineParametersApplyConfigToJobParameter maps to JobParameter

type PipelineParametersBuild

type PipelineParametersBuild struct {
	// Deprecated: use GitRef instead
	// Branch the branch to build
	// REQUIRED for "build" and "build-deploy" pipelines
	//
	// example: master
	Branch string `json:"branch"`

	// Name of environment to build for
	//
	// example: prod
	ToEnvironment string `json:"toEnvironment,omitempty"`

	// CommitID the commit ID of the branch to build
	// REQUIRED for "build" and "build-deploy" pipelines
	//
	// example: 4faca8595c5283a9d0f17a623b9255a0d9866a2e
	CommitID string `json:"commitID"`

	// PushImage should image be pushed to container registry. Defaults pushing
	//
	// example: true
	PushImage string `json:"pushImage"`

	// TriggeredBy of the job - if empty will use user token upn (user principle name)
	//
	// example: a_user@equinor.com
	TriggeredBy string `json:"triggeredBy,omitempty"`

	// ImageTag of the image - if empty will use default logic
	//
	// example: master-latest
	ImageTag string `json:"imageTag,omitempty"`

	// OverrideUseBuildCache override default or configured build cache option
	//
	// required: false
	// Extensions:
	// x-nullable: true
	OverrideUseBuildCache *bool `json:"overrideUseBuildCache,omitempty"`

	// RefreshBuildCache forces to rebuild cache when UseBuildCache is true in the RadixApplication or OverrideUseBuildCache is true
	//
	// required: false
	// Extensions:
	// x-nullable: true
	RefreshBuildCache *bool `json:"refreshBuildCache,omitempty"`

	// GitRef Branch or tag to build from
	// REQUIRED for "build" and "build-deploy" pipelines
	//
	// required: false
	// example: master
	GitRef string `json:"gitRef,omitempty"`

	// GitRefType When the pipeline job should be built from branch or tag specified in GitRef:
	// - branch
	// - tag
	// - <empty> - either branch or tag
	//
	// required: false
	// enum: branch,tag,""
	// example: branch
	GitRefType string `json:"gitRefType,omitempty"`
}

PipelineParametersBuild describe branch to build and its commit ID swagger:model PipelineParametersBuild

func (PipelineParametersBuild) MapPipelineParametersBuildToJobParameter

func (buildParam PipelineParametersBuild) MapPipelineParametersBuildToJobParameter() *jobModels.JobParameters

MapPipelineParametersBuildToJobParameter maps to JobParameter

func (PipelineParametersBuild) PushImageToContainerRegistry

func (buildParam PipelineParametersBuild) PushImageToContainerRegistry() bool

PushImageToContainerRegistry Normalises the "PushImage" param from a string

type PipelineParametersDeploy

type PipelineParametersDeploy struct {
	// Name of environment to deploy
	// REQUIRED for "deploy" pipeline
	//
	// example: prod
	ToEnvironment string `json:"toEnvironment"`

	// Image tags names for components
	//
	// example: {"component1":"tag1", "component2":"tag2"}
	ImageTagNames map[string]string `json:"imageTagNames"`

	// TriggeredBy of the job - if empty will use user token upn (user principle name)
	//
	// example: a_user@equinor.com
	TriggeredBy string `json:"triggeredBy,omitempty"`

	// CommitID the commit ID of the branch
	// OPTIONAL for information only
	//
	// example: 4faca8595c5283a9d0f17a623b9255a0d9866a2e
	CommitID string `json:"commitID,omitempty"`

	// ComponentsToDeploy List of components to deploy
	// OPTIONAL If specified, only these components are deployed
	//
	// required: false
	ComponentsToDeploy []string `json:"componentsToDeploy"`
}

PipelineParametersDeploy describes environment to deploy swagger:model PipelineParametersDeploy

func (PipelineParametersDeploy) MapPipelineParametersDeployToJobParameter

func (deployParam PipelineParametersDeploy) MapPipelineParametersDeployToJobParameter() *jobModels.JobParameters

MapPipelineParametersDeployToJobParameter maps to JobParameter

type PipelineParametersPromote

type PipelineParametersPromote struct {
	// ID of the deployment to promote
	// REQUIRED for "promote" pipeline
	//
	// example: dev-9tyu1-tftmnqzq
	DeploymentName string `json:"deploymentName"`

	// Name of environment where to look for the deployment to be promoted
	// REQUIRED for "promote" pipeline
	//
	// example: prod
	FromEnvironment string `json:"fromEnvironment"`

	// Name of environment to receive the promoted deployment
	// REQUIRED for "promote" pipeline
	//
	// example: prod
	ToEnvironment string `json:"toEnvironment"`

	// TriggeredBy of the job - if empty will use user token upn (user principle name)
	//
	// example: a_user@equinor.com
	TriggeredBy string `json:"triggeredBy,omitempty"`
}

PipelineParametersPromote identify deployment to promote and a target environment swagger:model PipelineParametersPromote

func (PipelineParametersPromote) MapPipelineParametersPromoteToJobParameter

func (promoteParam PipelineParametersPromote) MapPipelineParametersPromoteToJobParameter() *jobModels.JobParameters

MapPipelineParametersPromoteToJobParameter maps to JobParameter

type RegenerateDeployKeyData

type RegenerateDeployKeyData struct {
	// PrivateKey of the deploy key
	//
	// required: false
	PrivateKey string `json:"privateKey"`
}

RegenerateDeployKeyData Holds regenerated shared secret swagger:model RegenerateDeployKeyData

type RegenerateSharedSecretData

type RegenerateSharedSecretData struct {
	// SharedSecret of the shared secret
	//
	// required: false
	SharedSecret string `json:"sharedSecret"`
}

RegenerateSharedSecretData Holds regenerated shared secret swagger:model RegenerateSharedSecretData

type ReplicaResourcesUtilizationResponse

type ReplicaResourcesUtilizationResponse struct {
	Environments map[string]EnvironmentUtilization `json:"environments"`
}

ReplicaResourcesUtilizationResponse holds information about resource utilization swagger:model ReplicaResourcesUtilizationResponse

func NewPodResourcesUtilizationResponse

func NewPodResourcesUtilizationResponse() *ReplicaResourcesUtilizationResponse

func (*ReplicaResourcesUtilizationResponse) SetCpuAverage

func (r *ReplicaResourcesUtilizationResponse) SetCpuAverage(environment, component, pod string, value float64)

func (*ReplicaResourcesUtilizationResponse) SetCpuRequests

func (r *ReplicaResourcesUtilizationResponse) SetCpuRequests(environment, component, pod string, value float64)

func (*ReplicaResourcesUtilizationResponse) SetMemoryMaximum

func (r *ReplicaResourcesUtilizationResponse) SetMemoryMaximum(environment, component, pod string, value float64)

func (*ReplicaResourcesUtilizationResponse) SetMemoryRequests

func (r *ReplicaResourcesUtilizationResponse) SetMemoryRequests(environment, component, pod string, value float64)

type ReplicaUtilization

type ReplicaUtilization struct {
	// Memory Requests
	// required: true
	MemoryRequests float64 `json:"memoryRequests"`
	// Max memory used
	// required: true
	MemoryMaximum float64 `json:"memoryMaximum"`
	// Cpu Requests
	// required: true
	CpuRequests float64 `json:"cpuRequests"`
	// Average CPU Used
	// required: true
	CpuAverage float64 `json:"cpuAverage"`
}

Jump to

Keyboard shortcuts

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