apicontracts

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HealthUnknown   Health = iota
	HealthHealthy          = 1
	HealthUnhealthy        = 2
	HealthBad              = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessControlList added in v0.0.9

type AccessControlList struct {
	AccessGroups []string `json:"accessGroups"`
}

type Agent added in v0.0.9

type Agent struct {
	Version string `json:"version"`
	Sha     string `json:"sha"`
}

type AgentApiKeyModel added in v0.0.9

type AgentApiKeyModel struct {
	Identifier     string                 `json:"identifier" validate:"required,min=1,ne=' ',max=100"`
	DatacenterName string                 `json:"datacenterName" validate:"required,min=1,ne=' '"`
	WorkspaceName  string                 `json:"workspaceName" validate:"required,min=1,ne=' '"`
	Provider       providers.ProviderType `json:"provider" validate:"required,min=1,ne=' ',max=20"`
	Type           ApiKeyType             `json:"type" validate:"required,min=1,ne='',eq=Cluster"`
}

type ApiKey added in v0.0.9

type ApiKey struct {
	Id          string     `json:"id,omitempty" bson:"_id,omitempty"`
	Identifier  string     `json:"identifier" validate:"required,min=1,ne='',max=100,rortext"`
	DisplayName string     `json:"displayName,omitempty" validate:"required,min=3,ne='',max=20,rortext"`
	Type        ApiKeyType `json:"type" validate:"required,min=1,ne=''"`
	ReadOnly    bool       `json:"readOnly"`
	Expires     time.Time  `json:"expires,omitempty"`
	Created     time.Time  `json:"created,omitempty"`
	LastUsed    time.Time  `json:"lastUsed,omitempty"`
	Hash        string
}

func (ApiKey) IsExpired added in v0.0.9

func (key ApiKey) IsExpired() bool

type ApiKeyType added in v0.0.9

type ApiKeyType string
const (
	ApiKeyTypeUnknown ApiKeyType = ""
	ApiKeyTypeCluster ApiKeyType = "Cluster"
	ApiKeyTypeUser    ApiKeyType = "User"
	ApiKeyTypeService ApiKeyType = "Service"
)

type ArgoCdVersions added in v0.0.9

type ArgoCdVersions struct {
	Version     string `json:"version"`
	HelmVersion string `json:"helmVersion"`
}

type AuditLog added in v0.0.9

type AuditLog struct {
	ID       string           `json:"id" bson:"_id,omitempty"`
	Metadata AuditLogMetadata `json:"metadata"`
	Data     map[string]any   `json:"data"`
}

type AuditLogMetadata added in v0.0.9

type AuditLogMetadata struct {
	Msg       string    `json:"msg"`
	Timestamp time.Time `json:"timestamp"`
	Category  string    `json:"category"`
	Action    string    `json:"action"`
	User      User      `json:"user"`
}

type Billing added in v0.0.9

type Billing struct {
	Workorder string `json:"workorder"`
}

type BillingModel added in v0.0.9

type BillingModel struct {
	Workorder string `json:"workorder" validate:"required,min=1,rortext"`
}

type Cluster added in v0.0.9

type Cluster struct {
	ID            string            `json:"id" bson:"_id,omitempty"`
	Identifier    string            `json:"identifier"`
	ClusterIdOld  string            `json:"clusterIdOld" bson:"clusteridold"`
	ACL           AccessControlList `json:"acl"`
	ClusterId     string            `json:"clusterId"`
	ClusterName   string            `json:"clusterName"`
	WorkspaceId   string            `json:"workspaceId" bson:"workspaceid"`
	Workspace     Workspace         `json:"workspace" bson:"workspace"`
	Environment   string            `json:"environment"`
	Metrics       Metrics           `json:"metrics"`
	Topology      Topology          `json:"topology"`
	Versions      Versions          `json:"versions"`
	Ingresses     []Ingress         `json:"ingresses"`
	Updated       time.Time         `json:"updated,omitempty"`
	Created       time.Time         `json:"created,omitempty"`
	LastObserved  time.Time         `json:"lastObserved,omitempty"`
	FirstObserved time.Time         `json:"firstObserved,omitempty"`
	HealthStatus  HealthStatus      `json:"healthStatus"`
	CreatedBy     string            `json:"createdBy"`
	SplunkIndex   string            `json:"splunkIndex"`
	Config        ClusterConfig     `json:"config"`
	Metadata      ClusterMetadata   `json:"metadata"`
	Status        ClusterStatus     `json:"status"`
}

type ClusterCondition added in v0.0.9

type ClusterCondition struct {
	Type    ConditionType   `json:"type"`
	Status  ConditionStatus `json:"status"`
	Message string          `json:"message"`
	Created time.Time       `json:"created"`
	Updated time.Time       `json:"updated"`
}

type ClusterConfig added in v0.0.9

type ClusterConfig struct {
	Versions        map[string]interface{} `json:"versions"`
	Overrides       map[string]interface{} `json:"overrides"`
	ProjectMetadata ProjectMetadata        `json:"projectMetadata"`
}

type ClusterControlPlaneMetadata added in v0.0.9

type ClusterControlPlaneMetadata struct {
	ClusterId                interface{}                           `json:"clusterId"`
	ClusterName              interface{}                           `json:"clusterName"`
	Environment              interface{}                           `json:"environment"`
	ProjectName              interface{}                           `json:"projectName"`
	ControlPlaneEndpoint     ClusterControlPlaneMetadataIp         `json:"controlPlaneEndpoint"`
	ControlPlaneEndpointPort interface{}                           `json:"controlPlaneEndpointPort"`
	Egress                   ClusterControlPlaneMetadataIp         `json:"egress"`
	Datacenter               ClusterControlPlaneMetadataDatacenter `json:"datacenter"`
}

type ClusterControlPlaneMetadataDatacenter added in v0.0.9

type ClusterControlPlaneMetadataDatacenter struct {
	Name        interface{} `json:"name"`
	Provider    interface{} `json:"provider"`
	ApiEndpoint interface{} `json:"apiEndpoint"`
}

type ClusterControlPlaneMetadataIp added in v0.0.9

type ClusterControlPlaneMetadataIp struct {
	IpV4 interface{} `json:"ipv4"`
	IpV6 interface{} `json:"ipv6"`
}

type ClusterInfo added in v0.0.9

type ClusterInfo struct {
	Id          string          `json:"id" bson:"_id"`
	ClusterId   string          `json:"clusterId"`
	ClusterName string          `json:"clusterName"`
	Metadata    ClusterMetadata `json:"metadata"`
	Environment string          `json:"environment"`
}

type ClusterKubeconfig added in v0.0.9

type ClusterKubeconfig struct {
	Status   string `json:"status,omitempty"`
	Message  string `json:"message,omitempty"`
	Data     string `json:"data,omitempty"`
	DataType string `json:"dataType,omitempty"`
}

type ClusterMetadata added in v0.0.9

type ClusterMetadata struct {
	ProjectID   string            `json:"projectId,omitempty" bson:"projectid,omitempty"`
	Project     *Project          `json:"project,omitempty"`
	Criticality CriticalityLevel  `json:"criticality"`
	Sensitivity SensitivityLevel  `json:"sensitivity"`
	Description string            `json:"description"`
	ServiceTags map[string]string `json:"serviceTags"`
	Billing     Billing           `json:"billing"`
	Roles       []ProjectRole     `json:"roles"`
}

type ClusterMetadataModel added in v0.0.9

type ClusterMetadataModel struct {
	ProjectID   string            `json:"projectId" validate:"required,min=1"`
	Criticality CriticalityLevel  `json:"criticality" validate:"required,min=1,max=4"`
	Sensitivity SensitivityLevel  `json:"sensitivity" validate:"required,min=1,max=4"`
	Description string            `json:"description" validate:"omitempty,min=1,rortext"`
	ServiceTags map[string]string `json:"serviceTags" validate:"omitempty"`
	Billing     BillingModel      `json:"billing"`
	Roles       []ProjectRole     `json:"roles" validate:"required,gt=1,dive,required"`
}

type ClusterPhase added in v0.0.9

type ClusterPhase string
const (
	ClusterPhaseUnkown   ClusterPhase = "Unknown"
	ClusterPhaseCreating ClusterPhase = "Creating"
	ClusterPhaseReady    ClusterPhase = "Ready"
	ClusterPhaseUpdating ClusterPhase = "Updating"
	ClusterPhaseDeleting ClusterPhase = "Deleting"
	ClusterPhaseDeleted  ClusterPhase = "Deleted"
	ClusterPhaseError    ClusterPhase = "Error"
)

type ClusterSelf added in v0.0.9

type ClusterSelf struct {
	ClusterId string `json:"clusterId"`
}

type ClusterState added in v0.0.9

type ClusterState string
const (
	ClusterStateUnknown ClusterState = "Unknown"
	ClusterStateReady   ClusterState = "Ready"
	ClusterStateWarning ClusterState = "Warning"
	ClusterStateError   ClusterState = "Error"
)

type ClusterStatus added in v0.0.9

type ClusterStatus struct {
	State      ClusterState       `json:"state"`
	Phase      ClusterPhase       `json:"phase"`
	Conditions []ClusterCondition `json:"conditions"`
}

type ConditionStatus added in v0.0.9

type ConditionStatus string
const (
	ConditionStatusUnknown ConditionStatus = "Unknown"
	ConditionStatusTrue    ConditionStatus = "True"
	ConditionStatusFalse   ConditionStatus = "False"
)

type ConditionType added in v0.0.9

type ConditionType string
const (
	ConditionTypeUnknown      ConditionType = "Unknown"
	ConditionTypeClusterReady ConditionType = "ClusterReady"
	ConditionTypeToolingOk    ConditionType = "ToolingOk"
)

type ControlPlane added in v0.0.9

type ControlPlane struct {
	Nodes   []Node  `json:"nodes"`
	Metrics Metrics `json:"metrics"`
}

type CriticalityLevel added in v0.0.9

type CriticalityLevel int
const (
	CriticalityLevelUnknown        CriticalityLevel = iota
	CriticalityLevelOpen           CriticalityLevel = 1
	CriticalityLevelIntern         CriticalityLevel = 2
	CriticalityLevelShielded       CriticalityLevel = 3
	CriticalityLevelHighlyShielded CriticalityLevel = 4
)

type Datacenter added in v0.0.9

type Datacenter struct {
	ID          string                 `json:"id" bson:"_id,omitempty"`
	Name        string                 `json:"name"`
	Provider    providers.ProviderType `json:"provider"`
	Location    DatacenterLocation     `json:"location"`
	APIEndpoint string                 `json:"apiEndpoint"`
}

type DatacenterLocation added in v0.0.9

type DatacenterLocation struct {
	ID      string `json:"id" bson:"id,omitempty"`
	Region  string `json:"region"`
	Country string `json:"country"`
}

type DatacenterLocationModel added in v0.0.9

type DatacenterLocationModel struct {
	ID      string `json:"id" bson:"id,omitempty"`
	Region  string `json:"region" validate:"required,min=1,ne=' '" `
	Country string `json:"country" validate:"required,min=1,ne=' '" `
}

type DatacenterModel added in v0.0.9

type DatacenterModel struct {
	ID          string                  `json:"id" bson:"_id,omitempty"`
	Name        string                  `json:"name" validate:"required,min=1,ne=' '" `
	Provider    string                  `json:"provider" validate:"required,min=1,ne=' '" `
	Location    DatacenterLocationModel `json:"location" validate:"required"`
	APIEndpoint string                  `json:"apiEndpoint"`
}

type DesiredVersion added in v0.0.9

type DesiredVersion struct {
	Key   string      `json:"key" bson:"key"`
	Value interface{} `json:"value" bson:"value"`
}

type EndpointAddress added in v0.0.9

type EndpointAddress struct {
	NodeName string `json:"nodename"`
	PodName  string `json:"podnamespace" bson:"podnamespace"`
}

type EnvironmentType added in v0.0.9

type EnvironmentType int
const (
	EnvironmentUnknown     EnvironmentType = iota
	EnvironmentDevelopment EnvironmentType = 1
	EnvironmentTesting     EnvironmentType = 2
	EnvironmentQA          EnvironmentType = 3
	EnvironmentProduction  EnvironmentType = 4
)

type Error added in v0.0.9

type Error struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

DEPRECATED: User rorerror

github.com/NorskHelsenett/ror/pkg/helpers/rorerror

type FileNameAndData added in v0.0.9

type FileNameAndData struct {
	// +kubebuilder:validation:MinLength=1
	FileName string `json:"filename"`

	// +kubebuilder:validation:Required
	Data string `json:"data"`
}

type Filter added in v0.0.9

type Filter struct {
	Skip         int              `json:"skip"`
	Limit        int              `json:"limit"`
	Sort         []SortMetadata   `json:"sort" validate:"dive"`
	Filters      []FilterMetadata `json:"filters"`
	GlobalFilter any              `json:"globalFilter"`
}

type FilterMetadata added in v0.0.9

type FilterMetadata struct {
	Field     string        `json:"field"`
	Value     any           `json:"value"`
	MatchMode MatchModeType `json:"matchMode"`
}

type GitConfig added in v0.0.9

type GitConfig struct {
	Token string `json:"token"`

	User string `json:"user"`

	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:Pattern=^[https|git].*
	Repository string `json:"repository"`

	// +kubebuilder:validation:Required
	Branch string `json:"branch"`

	// +kubebuilder:validation:Required
	ProjectId int `json:"projectId"`
}

Gitconfig description

type Health added in v0.0.9

type Health int

type HealthStatus added in v0.0.9

type HealthStatus struct {
	Health   Health          `json:"health"`
	Messages []StatusMessage `json:"messages"`
}

type Ingress added in v0.0.9

type Ingress struct {
	UID       string        `json:"uid"`
	Health    Health        `json:"health"`
	Name      string        `json:"name"`
	Namespace string        `json:"namespace"`
	Class     string        `json:"class"`
	Rules     []IngressRule `json:"ingressrules" bson:"ingressrules"`
}

type IngressPath added in v0.0.9

type IngressPath struct {
	Path    string  `json:"path"`
	Service Service `json:"service"`
}

type IngressRule added in v0.0.9

type IngressRule struct {
	Hostname    string        `json:"hostname"`
	IPAddresses []string      `json:"ipaddresses"`
	Paths       []IngressPath `json:"rules" bson:"rules"`
}

type KeyValue added in v0.0.9

type KeyValue struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

Key Value struct

type KubeconfigCredentials added in v0.0.9

type KubeconfigCredentials struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type MatchModeType added in v0.0.9

type MatchModeType string
const (
	MatchModeUnknown  MatchModeType = "unknown"
	MatchModeContains MatchModeType = "contains"
	MatchModeEquals   MatchModeType = "equals"
	MatchModeIn       MatchModeType = "in"
)

type Metric added in v0.0.9

type Metric struct {
	Id               string `json:"id"`
	PriceMonth       int64  `json:"priceMonth"`
	PriceYear        int64  `json:"priceYear"`
	Cpu              int64  `json:"cpu"`
	Memory           int64  `json:"memory"`
	CpuConsumed      int64  `json:"cpuConsumed"`
	MemoryConsumed   int64  `json:"memoryConsumed"`
	CpuPercentage    int64  `json:"cpuPercentage"`
	MemoryPercentage int64  `json:"memoryPercentage"`
	NodePoolCount    int64  `json:"nodePoolCount"`
	NodeCount        int64  `json:"nodeCount"`
	ClusterCount     int64  `json:"clusterCount"`
}

type MetricItem added in v0.0.9

type MetricItem struct {
	Id      string  `json:"id"`
	Metrics Metrics `json:"metrics"`
}

type MetricList added in v0.0.9

type MetricList struct {
	Items []MetricItem `json:"items"`
}

type MetricMetadata added in v0.0.13

type MetricMetadata struct {
	Type      string `json:"type" bson:"type"`
	ClusterId string `json:"clusterId"  bson:"clusterId"`
	Name      string `json:"name" bson:"name"`
}

type Metrics added in v0.0.9

type Metrics struct {
	PriceMonth       int64 `json:"priceMonth"`
	PriceYear        int64 `json:"priceYear"`
	Cpu              int64 `json:"cpu"`
	Memory           int64 `json:"memory"`
	CpuConsumed      int64 `json:"cpuConsumed"`
	MemoryConsumed   int64 `json:"memoryConsumed"`
	CpuPercentage    int64 `json:"cpuPercentage"`
	MemoryPercentage int64 `json:"memoryPercentage"`
	NodePoolCount    int64 `json:"nodePoolCount"`
	NodeCount        int64 `json:"nodeCount"`
	ClusterCount     int64 `json:"clusterCount"`
}

type MetricsCustom added in v0.0.9

type MetricsCustom struct {
	Data []MetricsCustomItem `json:"data"`
}

type MetricsCustomItem added in v0.0.9

type MetricsCustomItem struct {
	Value int64  `json:"value"`
	Text  string `json:"text"`
}

type MetricsFilter added in v0.0.9

type MetricsFilter struct {
	// Type must be set to either node or pod
	Type     string `json:"type"`
	Metadata struct {
		ClusterId string `json:"clusterId,omitempty"`
		Name      string `json:"name,omitempty"`
		Namespace string `json:"namespace,omitempty"`
	} `json:"metadata"`
	Time struct {
		Resolution TimeResolution `json:"resolution,omitempty"`
		Start      time.Time      `json:"start,omitempty"`
		Stop       time.Time      `json:"stop,omitempty"`
	} `json:"time"`
	GroupBy struct {
		Name      bool `json:"name"`
		Namespace bool `json:"namespace"`
		Cluster   bool `json:"cluster"`
	} `json:"groupby"`
}

type MetricsReport added in v0.0.9

type MetricsReport struct {
	Owner apiresourcecontracts.ResourceOwnerReference `json:"owner"`
	Nodes []NodeMetric                                `json:"nodes"`
}

type MetricsResult added in v0.0.9

type MetricsResult struct {
	Key                 MetricsResultKey `json:"key" bson:"_id"`
	AvgCpu              float64          `json:"avgCpu"`
	AvgCpuAllocated     float64          `json:"avgAllocatedCpu,omitempty" bson:"avgAllocatedCpu,truncate"`
	AvgCpuPercentage    float64          `json:"avgPercentageCpu,omitempty" bson:"avgPercentageCpu,truncate"`
	AvgMemory           float64          `json:"avgMemory"`
	AvgMemoryAllocated  float64          `json:"avgAllocatedMemory,omitempty" bson:"avgAllocatedMemory,truncate"`
	AvgMemoryPercentage float64          `json:"avgPercentageMemory,omitempty" bson:"avgPercentageMemory,truncate"`
}

type MetricsResultKey added in v0.0.9

type MetricsResultKey struct {
	Date      MetricsResultKeyTime `json:"date,omitempty"`
	Name      string               `json:"name,omitempty"`
	Namespace string               `json:"namespace,omitempty"`
	ClusterId string               `json:"clusterId,omitempty"`
}

type MetricsResultKeyTime added in v0.0.9

type MetricsResultKeyTime struct {
	Year   int `json:"year,omitempty"`
	Month  int `json:"month,omitempty"`
	Day    int `json:"day,omitempty"`
	Hour   int `json:"hour"`
	Minute int `json:"minute"`
}

type MetricsTotal added in v0.0.9

type MetricsTotal struct {
	Cpu              int64 `json:"cpu"`
	Memory           int64 `json:"memory"`
	CpuConsumed      int64 `json:"cpuConsumed"`
	MemoryConsumed   int64 `json:"memoryConsumed"`
	CpuPercentage    int64 `json:"cpuPercentage"`
	MemoryPercentage int64 `json:"memoryPercentage"`
	NodePoolCount    int64 `json:"nodePoolCount"`
	NodeCount        int64 `json:"nodeCount"`
	ClusterCount     int64 `json:"clusterCount"`
	WorkspaceCount   int64 `json:"workspaceCount"`
	DatacenterCount  int64 `json:"datacenterCount"`
}

type NhnTooling added in v0.0.9

type NhnTooling struct {
	Version     string `json:"version"`
	Branch      string `json:"branch"`
	Environment string `json:"environment"`
}

type Node added in v0.0.9

type Node struct {
	Name                    string    `json:"name"`
	Role                    string    `json:"role"`
	Created                 time.Time `json:"created"`
	OsImage                 string    `json:"osImage"`
	MachineName             string    `json:"machineName"`
	Metrics                 Metrics   `json:"metrics"`
	Architecture            string    `json:"architecture"`
	ContainerRuntimeVersion string    `json:"containerRuntimeVersion"`
	KernelVersion           string    `json:"kernelVersion"`
	KubeProxyVersion        string    `json:"kubeProxyVersion"`
	KubeletVersion          string    `json:"kubeletVersion"`
	OperatingSystem         string    `json:"operatingSystem"`
	MachineClass            string    `json:"machineClass"`
}

type NodeMetric added in v0.0.9

type NodeMetric struct {
	Name             string    `json:"name"`
	TimeStamp        time.Time `json:"time"`
	CpuUsage         int64     `json:"cpu"`
	CpuAllocated     int64     `json:"cpuallocated,omitempty"`
	CpuPercentage    float64   `json:"cpupercentage,omitempty"`
	MemoryUsage      int64     `json:"memory"`
	MemoryAllocated  int64     `json:"memoryallocated,omitempty"`
	MemoryPercentage float64   `json:"memorypercentage,omitempty"`
}

type NodeMetricsList added in v0.0.9

type NodeMetricsList struct {
	Kind       string                `json:"kind"`
	APIVersion string                `json:"apiVersion"`
	Items      []NodeMetricsListItem `json:"items"`
}

type NodeMetricsListItem added in v0.0.9

type NodeMetricsListItem struct {
	Metadata struct {
		Name string `json:"name"`
	} `json:"metadata"`
	Timestamp time.Time `json:"timestamp"`
	Window    string    `json:"window"`
	Usage     struct {
		CPU    string `json:"cpu"`
		Memory string `json:"memory"`
	} `json:"usage"`
}

type NodePool added in v0.0.9

type NodePool struct {
	Name         string  `json:"name"`
	MachineClass string  `json:"machineClass"`
	Metrics      Metrics `json:"metrics"`
	Nodes        []Node  `json:"nodes"`
}

type NodeResources added in v0.0.9

type NodeResources struct {
	Allocated ResourceAllocated `json:"allocated"`
	Consumed  ResourceConsumed  `json:"consumed"`
}

type Nodes added in v0.0.9

type Nodes struct {
	ControlPlane ControlPlane `json:"controlplane"`
}

type OperatorConfig added in v0.0.9

type OperatorConfig struct {
	Id         string        `json:"id" bson:"_id"`
	ApiVersion string        `json:"apiVersion"`
	Kind       string        `json:"kind"`
	Spec       *OperatorSpec `json:"spec"`
}

type OperatorJob added in v0.0.9

type OperatorJob struct {
	// +kubebuilder:validation:MinLength=1
	ImageName string `json:"imageName" validate:"required"`
	// +kubebuilder:validation:MinLength=1
	ImageTag string `json:"imageTag" validate:"required"`
	// +optional
	RunOnce bool `json:"runOnce"`

	Version string `json:"version"`

	Cmd string `json:"cmd"`
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=10
	// +kubebuilder:default=3
	BackOffLimit int32 `json:"backoffLimit" validate:"min=1,max=10"`

	// +kubebuilder:validation:Minimum=30
	// +kubebuilder:validation:Maximum=600
	// +kubebuilder:default=180
	TimeOutInSeconds int64 `json:"timeoutInSeconds" validate:"min=30,max=600"`

	// +optional
	Configs []OperatorJobConfig `json:"configs"`
}

OperatorJob defines the config for a task assigned to the ror operator

func (*OperatorJob) DeepCopy added in v0.0.9

func (in *OperatorJob) DeepCopy() *OperatorJob

needed for kubernetes

func (*OperatorJob) DeepCopyInto added in v0.0.9

func (in *OperatorJob) DeepCopyInto(out *OperatorJob)

needed for kubernetes

type OperatorJobConfig added in v0.0.9

type OperatorJobConfig struct {
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name" validate:"required"`

	// +kubebuilder:validation:Required
	Type OperatorJobConfigType `json:"type" validate:"required"`

	// +kubebuilder:validation:MinLength=1
	Path string `json:"path,omitempty"`

	// +kubebuilder:validation:Required
	Data map[string]string `json:"data" validate:"required"`
}

type OperatorJobConfigType added in v0.0.9

type OperatorJobConfigType string
const (
	OperatorJobConfigTypeEnv  OperatorJobConfigType = "env"
	OperatorJobConfigTypeFile OperatorJobConfigType = "file"
)

type OperatorSpec added in v0.0.9

type OperatorSpec struct {
	ImagePostfix string         `json:"imagePostfix"`
	Tasks        []OperatorTask `json:"tasks"`
}

type OperatorTask added in v0.0.9

type OperatorTask struct {
	Index   uint   `json:"index"`
	Name    string `json:"name"`
	Version string `json:"version"`
	RunOnce bool   `json:"runOnce"`
}

type PaginatedResult added in v0.0.9

type PaginatedResult[T any] struct {
	Data       []T   `json:"data"`
	DataCount  int64 `json:"dataCount"`
	TotalCount int64 `json:"totalCount"`
	Offset     int64 `json:"offset"`
}

type PersistentVolumeClaimMetric added in v0.0.13

type PersistentVolumeClaimMetric struct {
	Metadata            MetricMetadata `json:"metadata" bson:"metadata"`
	Timestamp           time.Time      `json:"timestamp" bson:"timestamp"`
	RequestedAllocation string         `json:"requestedAllocation" bson:"requestedAllocation"`
}

type PodMetric added in v0.0.9

type PodMetric struct {
	Name        string    `json:"name"`
	Namespace   string    `json:"namespace"`
	TimeStamp   time.Time `json:"time"`
	CpuUsage    int64     `json:"cpu"`
	MemoryUsage int64     `json:"memory"`
}

type PodMetricsList added in v0.0.9

type PodMetricsList struct {
	Kind       string               `json:"kind"`
	APIVersion string               `json:"apiVersion"`
	Items      []PodMetricsListItem `json:"items"`
}

type PodMetricsListItem added in v0.0.9

type PodMetricsListItem struct {
	Metadata struct {
		Name      string `json:"name"`
		Namespace string `json:"namespace"`
	} `json:"metadata"`
	Timestamp  time.Time `json:"timestamp"`
	Window     string    `json:"window"`
	Containers []struct {
		Name  string `json:"name"`
		Usage struct {
			CPU    string `json:"cpu"`
			Memory string `json:"memory"`
		} `json:"usage"`
	} `json:"containers"`
}

type Price added in v0.0.9

type Price struct {
	ID           string                 `json:"id" bson:"_id,omitempty"`
	Provider     providers.ProviderType `json:"provider"`
	MachineClass string                 `json:"machineClass"`
	Cpu          int                    `json:"cpu"`
	Memory       int64                  `json:"memory"`
	MemoryBytes  int64                  `json:"memoryBytes"`
	Price        int                    `json:"price"`
	From         time.Time              `json:"from"`
	To           time.Time              `json:"to,omitempty"`
}

type Project added in v0.0.9

type Project struct {
	ID              string          `json:"id" bson:"_id,omitempty"`
	Name            string          `json:"name"`
	Description     string          `json:"description"`
	Active          bool            `json:"active"`
	Created         time.Time       `json:"created"`
	Updated         time.Time       `json:"updated"`
	ProjectMetadata ProjectMetadata `json:"projectMetadata"`
}

type ProjectContactInfo added in v0.0.9

type ProjectContactInfo struct {
	UPN   string `json:"upn"`
	Email string `json:"email"`
	Phone string `json:"phone"`
}

type ProjectContactInfoModel added in v0.0.9

type ProjectContactInfoModel struct {
	UPN   string `json:"upn" validate:"required,rortext"`
	Email string `json:"email" validate:"required,rortext"`
	Phone string `json:"phone" validate:"rortext"`
}

type ProjectMetadata added in v0.0.9

type ProjectMetadata struct {
	Roles       []ProjectRole     `json:"roles"`
	Billing     Billing           `json:"billing"`
	ServiceTags map[string]string `json:"serviceTags"`
}

type ProjectMetadataModel added in v0.0.9

type ProjectMetadataModel struct {
	Roles       []ProjectRoleModel `json:"roles" validate:"required,gt=1,dive,required"`
	Billing     BillingModel       `json:"billing" validate:"required"`
	ServiceTags map[string]string  `json:"serviceTags"`
}

type ProjectModel added in v0.0.9

type ProjectModel struct {
	ID              string               `json:"id" bson:"_id,omitempty"`
	Name            string               `json:"name" validate:"required,min=1,ne=' ',rortext" `
	Description     string               `json:"description" validate:"required,min=1,ne=' '" `
	Active          bool                 `json:"active"`
	Created         time.Time            `json:"created"`
	Updated         time.Time            `json:"updated"`
	ProjectMetadata ProjectMetadataModel `json:"projectMetadata" validate:"required" `
}

type ProjectRole added in v0.0.9

type ProjectRole struct {
	ContactInfo    ProjectContactInfo    `json:"contactInfo"`
	RoleDefinition ProjectRoleDefinition `json:"roleDefinition"`
}

type ProjectRoleDefinition added in v0.0.9

type ProjectRoleDefinition = string
const (
	ProjectRoleUnknown     ProjectRoleDefinition = ""
	ProjectRoleOwner       ProjectRoleDefinition = "Owner"
	ProjectRoleResponsible ProjectRoleDefinition = "Responsible"
)

type ProjectRoleModel added in v0.0.9

type ProjectRoleModel struct {
	ContactInfo    ProjectContactInfoModel `json:"contactInfo" validate:"required"`
	RoleDefinition ProjectRoleDefinition   `json:"roleDefinition" validate:"required,oneof=Owner Responsible" `
}

type ResourceAllocated added in v0.0.9

type ResourceAllocated struct {
	Cpu         int64 `json:"cpu"`
	MemoryBytes int64 `json:"memoryBytes"`
}

type ResourceConsumed added in v0.0.9

type ResourceConsumed struct {
	CpuMilliValue int64 `json:"cpuMilliValue"`
	MemoryBytes   int64 `json:"memoryBytes"`
}

type SSEClient added in v0.0.9

type SSEClient struct {
	Identity   identitymodels.Identity `json:"identity"`
	Connection chan string             `json:"connection"`
}

type SSEMessage added in v0.0.9

type SSEMessage struct {
	Event string `json:"event" validate:"required,min=1,ne=' '"`
	Data  any    `json:"data" validate:"required"`
}

type SensitivityLevel added in v0.0.9

type SensitivityLevel int
const (
	SensitivityLevelUnknown  SensitivityLevel = iota
	SensitivityLevelNormal   SensitivityLevel = 1
	SensitivityLevelModerate SensitivityLevel = 2
	SensitivityLevelHigh     SensitivityLevel = 3
	SensitivityLevelCritical SensitivityLevel = 4
)

type Service added in v0.0.9

type Service struct {
	Name      string            `json:"name"`
	Type      string            `json:"type"`
	Selector  string            `json:"selector" bson:"selector"`
	Ports     []ServicePort     `json:"ports"`
	Endpoints []EndpointAddress `json:"endpoints"`
}

type ServicePort added in v0.0.9

type ServicePort struct {
	Name     string `json:"name"`
	NodePort string `json:"nodeport"`
	Protocol string `json:"protocol"`
}

type SortMetadata added in v0.0.9

type SortMetadata struct {
	SortField string `json:"sortField"`
	SortOrder int    `json:"sortOrder"`
}

type StatusMessage added in v0.0.9

type StatusMessage struct {
	Time    time.Time `json:"time"`
	Message string    `json:"message"`
}

type TanzuKubeConfigPayload added in v0.0.9

type TanzuKubeConfigPayload struct {
	User          string `json:"user"`
	Password      string `json:"pwd"`
	DatacenterUrl string `json:"datacenterUrl"`
	ClusterName   string `json:"clusterName,omitempty"`
	ClusterId     string `json:"clusterId,omitempty"`
	WorkspaceName string `json:"workspaceName"`
	WorkspaceOnly bool   `json:"workspaceOnly"`
}

type Task added in v0.0.9

type Task struct {
	Id     primitive.ObjectID `json:"id" bson:"_id,omitempty"`
	Name   string             `json:"name" validate:"required"`
	Config TaskSpec           `json:"config" validate:"required"`
}

type TaskCollection added in v0.0.9

type TaskCollection struct {
	ID    string `json:"id" bson:"_id,omitempty"`
	Tasks []Task `json:"tasks"`
}

type TaskGitSource added in v0.0.9

type TaskGitSource struct {
	// +kubebuilder:validation:Required
	Type TaskSourceType `json:"type"`

	// +kubebuilder:validation:Required
	ContentPath string `json:"contentPath"`

	// +kubebuilder:validation:Required
	GitConfig GitConfig `json:"gitConfig"`
}

type TaskScripts added in v0.0.9

type TaskScripts struct {
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinItems=1
	FileNameAndData []FileNameAndData `json:"fileNameAndData"`

	// +kubebuilder:validation:Required
	ScriptDirectory string `json:"scriptDirectory"`
}

type TaskSecret added in v0.0.9

type TaskSecret struct {
	// +kubebuilder:validation:Required
	FileNameAndData []FileNameAndData `json:"fileNameAndData"`

	// +kubebuilder:validation:MinLength=1
	Path string `json:"path"`

	// +optional
	GitSource *TaskGitSource `json:"gitSource"`

	// +optional
	VaultSource *TaskVaultSource `json:"vaultSource"`
}

type TaskSourceType added in v0.0.9

type TaskSourceType string
const (
	Unknown TaskSourceType = ""
	Git     TaskSourceType = "git"
	Vault   TaskSourceType = "vault"
)

type TaskSpec added in v0.0.9

type TaskSpec struct {
	// +kubebuilder:validation:Required
	ImageName string `json:"imageName" validate:"required"`

	// +optional
	Cmd string `json:"cmd"`

	// +optional
	EnvVars []KeyValue `json:"envVars"`

	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=10
	// +kubebuilder:default=3
	BackOffLimit int32 `json:"backoffLimit" validate:"min=1,max=10"`

	// +kubebuilder:validation:Minimum=30
	// +kubebuilder:validation:Maximum=600
	// +kubebuilder:default=180
	TimeOutInSeconds int64 `json:"timeoutInSeconds" validate:"min=30,max=600"`

	// +kubebuilder:validation:Required
	Version string `json:"version" validate:"semver"`

	// +optional
	Secret *TaskSecret `json:"secret"`

	// +kubebuilder:validation:Required
	Scripts *TaskScripts `json:"scripts"`
}

Spesification of properties for a task

type TaskSpecType added in v0.0.9

type TaskSpecType = string
const (
	TaskSpecTypeUnknown   TaskSpecType = ""
	TaskSpecTypeSecret    TaskSpecType = "Secret"
	TaskSpecTypeConfigMap TaskSpecType = "ConfigMap"
)

type TaskVaultSource added in v0.0.9

type TaskVaultSource struct {
	// +kubebuilder:validation:Required
	Type TaskSourceType `json:"type"`

	// +kubebuilder:validation:Required
	VaultPath string `json:"vaultPath"`
}

type TimeResolution added in v0.0.9

type TimeResolution int
const (
	ResolutionUnknown TimeResolution = iota
	ResolutionYear
	ResolutionMonth
	ResolutionDay
	ResolutionHour
	ResolutionMinute
)

type Topology added in v0.0.9

type Topology struct {
	ControlPlaneEndpoint string       `json:"controlPlaneEndpoint"`
	EgressIp             string       `json:"egressIp"`
	ControlPlane         ControlPlane `json:"controlPlane"`
	NodePools            []NodePool   `validate:"min=1" json:"nodePools"`
}

type User added in v0.0.9

type User struct {
	Name   string   `json:"name"`
	Email  string   `json:"email"`
	Groups []string `json:"groups"`
}

type Versions added in v0.0.9

type Versions struct {
	Kubernetes string     `json:"kubernetes"`
	NhnTooling NhnTooling `json:"nhnTooling"`
	Agent      Agent      `json:"agent"`
}

type Workspace added in v0.0.9

type Workspace struct {
	ID           string     `json:"id" bson:"_id,omitempty"`
	Name         string     `json:"name"`
	DatacenterID string     `json:"datacenterId" bson:"datacenterid,omitempty"`
	Datacenter   Datacenter `json:"datacenter"`
}

Directories

Path Synopsis
package delivers apicontracts for resources
package delivers apicontracts for resources
v2

Jump to

Keyboard shortcuts

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