v1alpha1

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the upm v1alpha1 API group +kubebuilder:object:generate=true +groupName=upm.syntropycloud.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "upm.syntropycloud.io", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type Action

type Action string

Action defines the specific operation to be sent to the unit-agent. Each action corresponds to a gRPC method exposed by the unit-agent. +kubebuilder:validation:Enum=logical-backup;physical-backup;restore;gtid-purge;set-variable;clone

const (
	// LogicalBackupAction instructs the agent to perform a logical backup.
	LogicalBackupAction Action = "logical-backup"

	// PhysicalBackupAction instructs the agent to perform a physical backup.
	PhysicalBackupAction Action = "physical-backup"

	// RestoreAction instructs the agent to restore from a backup.
	RestoreAction Action = "restore"

	// GtidPurgeAction instructs the agent to purge GTID information (specific to MySQL).
	GtidPurgeAction Action = "gtid-purge"

	// SetVariableAction instructs the agent to set runtime configuration parameters.
	SetVariableAction Action = "set-variable"

	// CloneAction instructs the agent to perform a clone operation from another instance.
	CloneAction Action = "clone"
)

type GrpcCall

type GrpcCall struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   GrpcCallSpec   `json:"spec,omitempty"`
	Status GrpcCallStatus `json:"status,omitempty"`
}

GrpcCall is the Schema for the grpccalls API

func (*GrpcCall) DeepCopy

func (in *GrpcCall) DeepCopy() *GrpcCall

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrpcCall.

func (*GrpcCall) DeepCopyInto

func (in *GrpcCall) DeepCopyInto(out *GrpcCall)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GrpcCall) DeepCopyObject

func (in *GrpcCall) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type GrpcCallList

type GrpcCallList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []GrpcCall `json:"items"`
}

GrpcCallList contains a list of GrpcCall

func (*GrpcCallList) DeepCopy

func (in *GrpcCallList) DeepCopy() *GrpcCallList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrpcCallList.

func (*GrpcCallList) DeepCopyInto

func (in *GrpcCallList) DeepCopyInto(out *GrpcCallList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GrpcCallList) DeepCopyObject

func (in *GrpcCallList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type GrpcCallSpec

type GrpcCallSpec struct {
	// TargetUnit is the name of the target Unit custom resource.
	// This identifies which unit's agent the request should be sent to.
	TargetUnit string `json:"targetUnit"`

	// Type specifies the type of the target unit (e.g., mysql, proxysql, postgresql).
	// This helps the operator determine how to format and route the request.
	Type UnitType `json:"type"`

	// Action specifies which gRPC method should be called on the unit-agent.
	Action Action `json:"action"`

	// ttlSecondsAfterFinished limits the lifetime of a Grpc Call that has finished
	// execution (either Complete or Failed). If this field is set,
	// ttlSecondsAfterFinished after the Grpc Call finishes, it is eligible to be
	// automatically deleted.
	TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished"`

	// Parameters provides a flexible map of key-value pairs used as arguments
	// to the gRPC call. The exact keys depend on the action type.
	// For example: {"BACKUP_MODE": "physical", "S3_BUCKET": "my-bucket"}
	// +kubebuilder:pruning:PreserveUnknownFields
	Parameters map[string]apiextensionsv1.JSON `json:"parameters"`
}

GrpcCallSpec defines the desired behavior of a GrpcCall custom resource. Each GrpcCall instance represents a single request to a unit-agent running in a unit pod.

func (*GrpcCallSpec) DeepCopy

func (in *GrpcCallSpec) DeepCopy() *GrpcCallSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrpcCallSpec.

func (*GrpcCallSpec) DeepCopyInto

func (in *GrpcCallSpec) DeepCopyInto(out *GrpcCallSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GrpcCallStatus

type GrpcCallStatus struct {
	// Result indicates the final outcome of the gRPC call.
	// Valid values: "Success", "Failed".
	Result Result `json:"result"`

	// Message contains additional context about the result,
	// such as error details, logs, or debug output.
	Message string `json:"message"`

	// CompletionTime is the timestamp when the gRPC call completed.
	// +optional
	CompletionTime *metav1.Time `json:"completionTime,omitempty"`

	// StartTime is the timestamp when the controller started processing the gRPC call.
	// +optional
	StartTime *metav1.Time `json:"startTime,omitempty"`
}

GrpcCallStatus defines the observed state of a GrpcCall. It records the execution result and related information returned by the unit-agent after invoking the specified gRPC action.

func (*GrpcCallStatus) DeepCopy

func (in *GrpcCallStatus) DeepCopy() *GrpcCallStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrpcCallStatus.

func (*GrpcCallStatus) DeepCopyInto

func (in *GrpcCallStatus) DeepCopyInto(out *GrpcCallStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Result

type Result string

Result defines the outcome status of a GrpcCall execution. It represents the final state of the gRPC request sent to the unit-agent. +kubebuilder:validation:Enum=Success;Failed

const (
	// SuccessResult indicates that the gRPC call was completed successfully.
	SuccessResult Result = "Success"

	// FailedResult indicates that the gRPC call failed due to an error during execution.
	FailedResult Result = "Failed"
)

type UnitType

type UnitType string

UnitType defines the type of unit this GrpcCall will interact with. Currently supported types are "mysql", "proxysql" and "postgresql". +kubebuilder:validation:Enum=mysql;postgresql;proxysql

const (
	// MysqlType represents a MySQL unit.
	MysqlType UnitType = "mysql"

	// PostgresqlType represents a PostgreSQL unit.
	PostgresqlType UnitType = "postgresql"

	// ProxysqlType represents a ProxySQL unit.
	ProxysqlType UnitType = "proxysql"
)

Jump to

Keyboard shortcuts

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