mirror of
https://github.com/TronoSfera/backupy-agent.git
synced 2026-05-18 10:03:30 +03:00
Source ports from the TronoSfera/backupy-cloud monorepo:
- apps/agent/ — Go agent (WSS client, persistent queue, Docker
discovery, 5 DB drivers: PG/MySQL/Mongo/Redis/SQLite,
pre/post hooks, Prometheus metrics)
- apps/backupy-decrypt/ — standalone CLI for client-side decryption
- packages/proto/ — protobuf wire format (generated .pb.go committed
so the repo builds without protoc)
- docs/ — agent spec + wire-protocol contract
Apache-2.0 license. Image published to ghcr.io/tronosfera/backupy-agent
on every v* tag via .github/workflows/release.yml (multi-arch amd64+arm64).
886 lines
25 KiB
Go
886 lines
25 KiB
Go
// Backupy protobuf v1 — see docs/07-api-contract.md
|
|
//
|
|
// Shared enums and messages used across agent_to_server and server_to_agent
|
|
// payloads. Keep this file dependency-free — only primitives and other
|
|
// definitions from this same file may appear here.
|
|
|
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// versions:
|
|
// protoc-gen-go v1.36.11
|
|
// protoc (unknown)
|
|
// source: backupv1/common.proto
|
|
|
|
package backupv1
|
|
|
|
import (
|
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
reflect "reflect"
|
|
sync "sync"
|
|
unsafe "unsafe"
|
|
)
|
|
|
|
const (
|
|
// Verify that this generated code is sufficiently up-to-date.
|
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
|
)
|
|
|
|
// JobStatus is the lifecycle state for a backup or restore job.
|
|
// See docs/07-api-contract.md §4 (JobUpdate, RestoreUpdate).
|
|
type JobStatus int32
|
|
|
|
const (
|
|
JobStatus_JOB_STATUS_UNSPECIFIED JobStatus = 0
|
|
JobStatus_QUEUED JobStatus = 1
|
|
JobStatus_RUNNING JobStatus = 2
|
|
JobStatus_SUCCESS JobStatus = 3
|
|
JobStatus_FAILED JobStatus = 4
|
|
JobStatus_CANCELLED JobStatus = 5
|
|
)
|
|
|
|
// Enum value maps for JobStatus.
|
|
var (
|
|
JobStatus_name = map[int32]string{
|
|
0: "JOB_STATUS_UNSPECIFIED",
|
|
1: "QUEUED",
|
|
2: "RUNNING",
|
|
3: "SUCCESS",
|
|
4: "FAILED",
|
|
5: "CANCELLED",
|
|
}
|
|
JobStatus_value = map[string]int32{
|
|
"JOB_STATUS_UNSPECIFIED": 0,
|
|
"QUEUED": 1,
|
|
"RUNNING": 2,
|
|
"SUCCESS": 3,
|
|
"FAILED": 4,
|
|
"CANCELLED": 5,
|
|
}
|
|
)
|
|
|
|
func (x JobStatus) Enum() *JobStatus {
|
|
p := new(JobStatus)
|
|
*p = x
|
|
return p
|
|
}
|
|
|
|
func (x JobStatus) String() string {
|
|
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
|
}
|
|
|
|
func (JobStatus) Descriptor() protoreflect.EnumDescriptor {
|
|
return file_backupv1_common_proto_enumTypes[0].Descriptor()
|
|
}
|
|
|
|
func (JobStatus) Type() protoreflect.EnumType {
|
|
return &file_backupv1_common_proto_enumTypes[0]
|
|
}
|
|
|
|
func (x JobStatus) Number() protoreflect.EnumNumber {
|
|
return protoreflect.EnumNumber(x)
|
|
}
|
|
|
|
// Deprecated: Use JobStatus.Descriptor instead.
|
|
func (JobStatus) EnumDescriptor() ([]byte, []int) {
|
|
return file_backupv1_common_proto_rawDescGZIP(), []int{0}
|
|
}
|
|
|
|
// DbType enumerates supported database engines for targets.
|
|
// See docs/07-api-contract.md §5 (Target).
|
|
type DbType int32
|
|
|
|
const (
|
|
DbType_DB_UNSPECIFIED DbType = 0
|
|
DbType_POSTGRESQL DbType = 1
|
|
DbType_MYSQL DbType = 2
|
|
DbType_MARIADB DbType = 3
|
|
DbType_MONGODB DbType = 4
|
|
DbType_REDIS DbType = 5
|
|
DbType_SQLITE DbType = 6
|
|
)
|
|
|
|
// Enum value maps for DbType.
|
|
var (
|
|
DbType_name = map[int32]string{
|
|
0: "DB_UNSPECIFIED",
|
|
1: "POSTGRESQL",
|
|
2: "MYSQL",
|
|
3: "MARIADB",
|
|
4: "MONGODB",
|
|
5: "REDIS",
|
|
6: "SQLITE",
|
|
}
|
|
DbType_value = map[string]int32{
|
|
"DB_UNSPECIFIED": 0,
|
|
"POSTGRESQL": 1,
|
|
"MYSQL": 2,
|
|
"MARIADB": 3,
|
|
"MONGODB": 4,
|
|
"REDIS": 5,
|
|
"SQLITE": 6,
|
|
}
|
|
)
|
|
|
|
func (x DbType) Enum() *DbType {
|
|
p := new(DbType)
|
|
*p = x
|
|
return p
|
|
}
|
|
|
|
func (x DbType) String() string {
|
|
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
|
}
|
|
|
|
func (DbType) Descriptor() protoreflect.EnumDescriptor {
|
|
return file_backupv1_common_proto_enumTypes[1].Descriptor()
|
|
}
|
|
|
|
func (DbType) Type() protoreflect.EnumType {
|
|
return &file_backupv1_common_proto_enumTypes[1]
|
|
}
|
|
|
|
func (x DbType) Number() protoreflect.EnumNumber {
|
|
return protoreflect.EnumNumber(x)
|
|
}
|
|
|
|
// Deprecated: Use DbType.Descriptor instead.
|
|
func (DbType) EnumDescriptor() ([]byte, []int) {
|
|
return file_backupv1_common_proto_rawDescGZIP(), []int{1}
|
|
}
|
|
|
|
// ConnectionStrategy is how the agent reaches the database.
|
|
// See docs/07-api-contract.md §5 (ConnectionConfig).
|
|
type ConnectionStrategy int32
|
|
|
|
const (
|
|
ConnectionStrategy_TCP ConnectionStrategy = 0
|
|
ConnectionStrategy_DOCKER_EXEC ConnectionStrategy = 1
|
|
ConnectionStrategy_UNIX_SOCKET ConnectionStrategy = 2
|
|
)
|
|
|
|
// Enum value maps for ConnectionStrategy.
|
|
var (
|
|
ConnectionStrategy_name = map[int32]string{
|
|
0: "TCP",
|
|
1: "DOCKER_EXEC",
|
|
2: "UNIX_SOCKET",
|
|
}
|
|
ConnectionStrategy_value = map[string]int32{
|
|
"TCP": 0,
|
|
"DOCKER_EXEC": 1,
|
|
"UNIX_SOCKET": 2,
|
|
}
|
|
)
|
|
|
|
func (x ConnectionStrategy) Enum() *ConnectionStrategy {
|
|
p := new(ConnectionStrategy)
|
|
*p = x
|
|
return p
|
|
}
|
|
|
|
func (x ConnectionStrategy) String() string {
|
|
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
|
}
|
|
|
|
func (ConnectionStrategy) Descriptor() protoreflect.EnumDescriptor {
|
|
return file_backupv1_common_proto_enumTypes[2].Descriptor()
|
|
}
|
|
|
|
func (ConnectionStrategy) Type() protoreflect.EnumType {
|
|
return &file_backupv1_common_proto_enumTypes[2]
|
|
}
|
|
|
|
func (x ConnectionStrategy) Number() protoreflect.EnumNumber {
|
|
return protoreflect.EnumNumber(x)
|
|
}
|
|
|
|
// Deprecated: Use ConnectionStrategy.Descriptor instead.
|
|
func (ConnectionStrategy) EnumDescriptor() ([]byte, []int) {
|
|
return file_backupv1_common_proto_rawDescGZIP(), []int{2}
|
|
}
|
|
|
|
// CheckType enumerates supported health-check probe types.
|
|
// See docs/07-api-contract.md §5 (HealthCheckSpec).
|
|
type CheckType int32
|
|
|
|
const (
|
|
CheckType_HTTP CheckType = 0
|
|
CheckType_HTTPS CheckType = 1
|
|
CheckType_TCP_CHECK CheckType = 2
|
|
)
|
|
|
|
// Enum value maps for CheckType.
|
|
var (
|
|
CheckType_name = map[int32]string{
|
|
0: "HTTP",
|
|
1: "HTTPS",
|
|
2: "TCP_CHECK",
|
|
}
|
|
CheckType_value = map[string]int32{
|
|
"HTTP": 0,
|
|
"HTTPS": 1,
|
|
"TCP_CHECK": 2,
|
|
}
|
|
)
|
|
|
|
func (x CheckType) Enum() *CheckType {
|
|
p := new(CheckType)
|
|
*p = x
|
|
return p
|
|
}
|
|
|
|
func (x CheckType) String() string {
|
|
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
|
}
|
|
|
|
func (CheckType) Descriptor() protoreflect.EnumDescriptor {
|
|
return file_backupv1_common_proto_enumTypes[3].Descriptor()
|
|
}
|
|
|
|
func (CheckType) Type() protoreflect.EnumType {
|
|
return &file_backupv1_common_proto_enumTypes[3]
|
|
}
|
|
|
|
func (x CheckType) Number() protoreflect.EnumNumber {
|
|
return protoreflect.EnumNumber(x)
|
|
}
|
|
|
|
// Deprecated: Use CheckType.Descriptor instead.
|
|
func (CheckType) EnumDescriptor() ([]byte, []int) {
|
|
return file_backupv1_common_proto_rawDescGZIP(), []int{3}
|
|
}
|
|
|
|
// LogLevel is the severity for LogEvent records streamed by the agent.
|
|
// See docs/07-api-contract.md §4 (LogEvent).
|
|
type LogLevel int32
|
|
|
|
const (
|
|
LogLevel_TRACE LogLevel = 0
|
|
LogLevel_DEBUG LogLevel = 1
|
|
LogLevel_INFO LogLevel = 2
|
|
LogLevel_WARN LogLevel = 3
|
|
LogLevel_ERROR LogLevel = 4
|
|
)
|
|
|
|
// Enum value maps for LogLevel.
|
|
var (
|
|
LogLevel_name = map[int32]string{
|
|
0: "TRACE",
|
|
1: "DEBUG",
|
|
2: "INFO",
|
|
3: "WARN",
|
|
4: "ERROR",
|
|
}
|
|
LogLevel_value = map[string]int32{
|
|
"TRACE": 0,
|
|
"DEBUG": 1,
|
|
"INFO": 2,
|
|
"WARN": 3,
|
|
"ERROR": 4,
|
|
}
|
|
)
|
|
|
|
func (x LogLevel) Enum() *LogLevel {
|
|
p := new(LogLevel)
|
|
*p = x
|
|
return p
|
|
}
|
|
|
|
func (x LogLevel) String() string {
|
|
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
|
}
|
|
|
|
func (LogLevel) Descriptor() protoreflect.EnumDescriptor {
|
|
return file_backupv1_common_proto_enumTypes[4].Descriptor()
|
|
}
|
|
|
|
func (LogLevel) Type() protoreflect.EnumType {
|
|
return &file_backupv1_common_proto_enumTypes[4]
|
|
}
|
|
|
|
func (x LogLevel) Number() protoreflect.EnumNumber {
|
|
return protoreflect.EnumNumber(x)
|
|
}
|
|
|
|
// Deprecated: Use LogLevel.Descriptor instead.
|
|
func (LogLevel) EnumDescriptor() ([]byte, []int) {
|
|
return file_backupv1_common_proto_rawDescGZIP(), []int{4}
|
|
}
|
|
|
|
// AgentMetrics is the snapshot of host resource usage attached to Heartbeat.
|
|
// See docs/07-api-contract.md §4 (Heartbeat).
|
|
type AgentMetrics struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
CpuPercent float32 `protobuf:"fixed32,1,opt,name=cpu_percent,json=cpuPercent,proto3" json:"cpu_percent,omitempty"`
|
|
MemUsedBytes uint64 `protobuf:"varint,2,opt,name=mem_used_bytes,json=memUsedBytes,proto3" json:"mem_used_bytes,omitempty"`
|
|
MemTotalBytes uint64 `protobuf:"varint,3,opt,name=mem_total_bytes,json=memTotalBytes,proto3" json:"mem_total_bytes,omitempty"`
|
|
DiskUsedBytes uint64 `protobuf:"varint,4,opt,name=disk_used_bytes,json=diskUsedBytes,proto3" json:"disk_used_bytes,omitempty"`
|
|
DiskTotalBytes uint64 `protobuf:"varint,5,opt,name=disk_total_bytes,json=diskTotalBytes,proto3" json:"disk_total_bytes,omitempty"`
|
|
QueueDepth uint32 `protobuf:"varint,6,opt,name=queue_depth,json=queueDepth,proto3" json:"queue_depth,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *AgentMetrics) Reset() {
|
|
*x = AgentMetrics{}
|
|
mi := &file_backupv1_common_proto_msgTypes[0]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *AgentMetrics) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*AgentMetrics) ProtoMessage() {}
|
|
|
|
func (x *AgentMetrics) ProtoReflect() protoreflect.Message {
|
|
mi := &file_backupv1_common_proto_msgTypes[0]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use AgentMetrics.ProtoReflect.Descriptor instead.
|
|
func (*AgentMetrics) Descriptor() ([]byte, []int) {
|
|
return file_backupv1_common_proto_rawDescGZIP(), []int{0}
|
|
}
|
|
|
|
func (x *AgentMetrics) GetCpuPercent() float32 {
|
|
if x != nil {
|
|
return x.CpuPercent
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *AgentMetrics) GetMemUsedBytes() uint64 {
|
|
if x != nil {
|
|
return x.MemUsedBytes
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *AgentMetrics) GetMemTotalBytes() uint64 {
|
|
if x != nil {
|
|
return x.MemTotalBytes
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *AgentMetrics) GetDiskUsedBytes() uint64 {
|
|
if x != nil {
|
|
return x.DiskUsedBytes
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *AgentMetrics) GetDiskTotalBytes() uint64 {
|
|
if x != nil {
|
|
return x.DiskTotalBytes
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *AgentMetrics) GetQueueDepth() uint32 {
|
|
if x != nil {
|
|
return x.QueueDepth
|
|
}
|
|
return 0
|
|
}
|
|
|
|
// PortBinding describes a single container port published on the host.
|
|
// See docs/07-api-contract.md §4 (DiscoveryReport).
|
|
type PortBinding struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
ContainerPort uint32 `protobuf:"varint,1,opt,name=container_port,json=containerPort,proto3" json:"container_port,omitempty"`
|
|
HostPort uint32 `protobuf:"varint,2,opt,name=host_port,json=hostPort,proto3" json:"host_port,omitempty"`
|
|
Protocol string `protobuf:"bytes,3,opt,name=protocol,proto3" json:"protocol,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *PortBinding) Reset() {
|
|
*x = PortBinding{}
|
|
mi := &file_backupv1_common_proto_msgTypes[1]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *PortBinding) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*PortBinding) ProtoMessage() {}
|
|
|
|
func (x *PortBinding) ProtoReflect() protoreflect.Message {
|
|
mi := &file_backupv1_common_proto_msgTypes[1]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use PortBinding.ProtoReflect.Descriptor instead.
|
|
func (*PortBinding) Descriptor() ([]byte, []int) {
|
|
return file_backupv1_common_proto_rawDescGZIP(), []int{1}
|
|
}
|
|
|
|
func (x *PortBinding) GetContainerPort() uint32 {
|
|
if x != nil {
|
|
return x.ContainerPort
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *PortBinding) GetHostPort() uint32 {
|
|
if x != nil {
|
|
return x.HostPort
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *PortBinding) GetProtocol() string {
|
|
if x != nil {
|
|
return x.Protocol
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// S3UploadCreds is a presigned PUT URL the agent uses to upload the encrypted
|
|
// backup blob. See docs/07-api-contract.md §5 (RunBackup).
|
|
type S3UploadCreds struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
PresignedPutUrl string `protobuf:"bytes,1,opt,name=presigned_put_url,json=presignedPutUrl,proto3" json:"presigned_put_url,omitempty"`
|
|
ExpiresAtMs uint64 `protobuf:"varint,2,opt,name=expires_at_ms,json=expiresAtMs,proto3" json:"expires_at_ms,omitempty"`
|
|
FinalS3Key string `protobuf:"bytes,3,opt,name=final_s3_key,json=finalS3Key,proto3" json:"final_s3_key,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *S3UploadCreds) Reset() {
|
|
*x = S3UploadCreds{}
|
|
mi := &file_backupv1_common_proto_msgTypes[2]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *S3UploadCreds) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*S3UploadCreds) ProtoMessage() {}
|
|
|
|
func (x *S3UploadCreds) ProtoReflect() protoreflect.Message {
|
|
mi := &file_backupv1_common_proto_msgTypes[2]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use S3UploadCreds.ProtoReflect.Descriptor instead.
|
|
func (*S3UploadCreds) Descriptor() ([]byte, []int) {
|
|
return file_backupv1_common_proto_rawDescGZIP(), []int{2}
|
|
}
|
|
|
|
func (x *S3UploadCreds) GetPresignedPutUrl() string {
|
|
if x != nil {
|
|
return x.PresignedPutUrl
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *S3UploadCreds) GetExpiresAtMs() uint64 {
|
|
if x != nil {
|
|
return x.ExpiresAtMs
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *S3UploadCreds) GetFinalS3Key() string {
|
|
if x != nil {
|
|
return x.FinalS3Key
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// S3DownloadCreds is a presigned GET URL for fetching a backup blob (reserved
|
|
// for future restore-via-agent flows). Not used in MVP — Phase 3.
|
|
type S3DownloadCreds struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
PresignedGetUrl string `protobuf:"bytes,1,opt,name=presigned_get_url,json=presignedGetUrl,proto3" json:"presigned_get_url,omitempty"`
|
|
ExpiresAtMs uint64 `protobuf:"varint,2,opt,name=expires_at_ms,json=expiresAtMs,proto3" json:"expires_at_ms,omitempty"`
|
|
S3Key string `protobuf:"bytes,3,opt,name=s3_key,json=s3Key,proto3" json:"s3_key,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *S3DownloadCreds) Reset() {
|
|
*x = S3DownloadCreds{}
|
|
mi := &file_backupv1_common_proto_msgTypes[3]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *S3DownloadCreds) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*S3DownloadCreds) ProtoMessage() {}
|
|
|
|
func (x *S3DownloadCreds) ProtoReflect() protoreflect.Message {
|
|
mi := &file_backupv1_common_proto_msgTypes[3]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use S3DownloadCreds.ProtoReflect.Descriptor instead.
|
|
func (*S3DownloadCreds) Descriptor() ([]byte, []int) {
|
|
return file_backupv1_common_proto_rawDescGZIP(), []int{3}
|
|
}
|
|
|
|
func (x *S3DownloadCreds) GetPresignedGetUrl() string {
|
|
if x != nil {
|
|
return x.PresignedGetUrl
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *S3DownloadCreds) GetExpiresAtMs() uint64 {
|
|
if x != nil {
|
|
return x.ExpiresAtMs
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *S3DownloadCreds) GetS3Key() string {
|
|
if x != nil {
|
|
return x.S3Key
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// RetryPolicy controls how the agent retries a failed backup job.
|
|
// See docs/07-api-contract.md §5 (BackupJobSpec).
|
|
type RetryPolicy struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
MaxAttempts uint32 `protobuf:"varint,1,opt,name=max_attempts,json=maxAttempts,proto3" json:"max_attempts,omitempty"`
|
|
BackoffSeconds []uint32 `protobuf:"varint,2,rep,packed,name=backoff_seconds,json=backoffSeconds,proto3" json:"backoff_seconds,omitempty"` // e.g. [60, 300, 1800]
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *RetryPolicy) Reset() {
|
|
*x = RetryPolicy{}
|
|
mi := &file_backupv1_common_proto_msgTypes[4]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *RetryPolicy) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*RetryPolicy) ProtoMessage() {}
|
|
|
|
func (x *RetryPolicy) ProtoReflect() protoreflect.Message {
|
|
mi := &file_backupv1_common_proto_msgTypes[4]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use RetryPolicy.ProtoReflect.Descriptor instead.
|
|
func (*RetryPolicy) Descriptor() ([]byte, []int) {
|
|
return file_backupv1_common_proto_rawDescGZIP(), []int{4}
|
|
}
|
|
|
|
func (x *RetryPolicy) GetMaxAttempts() uint32 {
|
|
if x != nil {
|
|
return x.MaxAttempts
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *RetryPolicy) GetBackoffSeconds() []uint32 {
|
|
if x != nil {
|
|
return x.BackoffSeconds
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MaintenanceWindow defines a UTC time-of-day window where backups are paused.
|
|
// See docs/07-api-contract.md §5 (AgentConfig).
|
|
type MaintenanceWindow struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
StartUtc string `protobuf:"bytes,1,opt,name=start_utc,json=startUtc,proto3" json:"start_utc,omitempty"` // "02:00"
|
|
EndUtc string `protobuf:"bytes,2,opt,name=end_utc,json=endUtc,proto3" json:"end_utc,omitempty"` // "05:00"
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *MaintenanceWindow) Reset() {
|
|
*x = MaintenanceWindow{}
|
|
mi := &file_backupv1_common_proto_msgTypes[5]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *MaintenanceWindow) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*MaintenanceWindow) ProtoMessage() {}
|
|
|
|
func (x *MaintenanceWindow) ProtoReflect() protoreflect.Message {
|
|
mi := &file_backupv1_common_proto_msgTypes[5]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use MaintenanceWindow.ProtoReflect.Descriptor instead.
|
|
func (*MaintenanceWindow) Descriptor() ([]byte, []int) {
|
|
return file_backupv1_common_proto_rawDescGZIP(), []int{5}
|
|
}
|
|
|
|
func (x *MaintenanceWindow) GetStartUtc() string {
|
|
if x != nil {
|
|
return x.StartUtc
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *MaintenanceWindow) GetEndUtc() string {
|
|
if x != nil {
|
|
return x.EndUtc
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// AdvancedSettings carries miscellaneous tunables pushed in AgentConfig.
|
|
// See docs/07-api-contract.md §5 (AgentConfig).
|
|
type AdvancedSettings struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
MaxParallelJobs uint32 `protobuf:"varint,1,opt,name=max_parallel_jobs,json=maxParallelJobs,proto3" json:"max_parallel_jobs,omitempty"`
|
|
LogLevel string `protobuf:"bytes,2,opt,name=log_level,json=logLevel,proto3" json:"log_level,omitempty"`
|
|
AutoUpdateEnabled bool `protobuf:"varint,3,opt,name=auto_update_enabled,json=autoUpdateEnabled,proto3" json:"auto_update_enabled,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *AdvancedSettings) Reset() {
|
|
*x = AdvancedSettings{}
|
|
mi := &file_backupv1_common_proto_msgTypes[6]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *AdvancedSettings) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*AdvancedSettings) ProtoMessage() {}
|
|
|
|
func (x *AdvancedSettings) ProtoReflect() protoreflect.Message {
|
|
mi := &file_backupv1_common_proto_msgTypes[6]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use AdvancedSettings.ProtoReflect.Descriptor instead.
|
|
func (*AdvancedSettings) Descriptor() ([]byte, []int) {
|
|
return file_backupv1_common_proto_rawDescGZIP(), []int{6}
|
|
}
|
|
|
|
func (x *AdvancedSettings) GetMaxParallelJobs() uint32 {
|
|
if x != nil {
|
|
return x.MaxParallelJobs
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *AdvancedSettings) GetLogLevel() string {
|
|
if x != nil {
|
|
return x.LogLevel
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *AdvancedSettings) GetAutoUpdateEnabled() bool {
|
|
if x != nil {
|
|
return x.AutoUpdateEnabled
|
|
}
|
|
return false
|
|
}
|
|
|
|
var File_backupv1_common_proto protoreflect.FileDescriptor
|
|
|
|
const file_backupv1_common_proto_rawDesc = "" +
|
|
"\n" +
|
|
"\x15backupv1/common.proto\x12\tbackup.v1\"\xf0\x01\n" +
|
|
"\fAgentMetrics\x12\x1f\n" +
|
|
"\vcpu_percent\x18\x01 \x01(\x02R\n" +
|
|
"cpuPercent\x12$\n" +
|
|
"\x0emem_used_bytes\x18\x02 \x01(\x04R\fmemUsedBytes\x12&\n" +
|
|
"\x0fmem_total_bytes\x18\x03 \x01(\x04R\rmemTotalBytes\x12&\n" +
|
|
"\x0fdisk_used_bytes\x18\x04 \x01(\x04R\rdiskUsedBytes\x12(\n" +
|
|
"\x10disk_total_bytes\x18\x05 \x01(\x04R\x0ediskTotalBytes\x12\x1f\n" +
|
|
"\vqueue_depth\x18\x06 \x01(\rR\n" +
|
|
"queueDepth\"m\n" +
|
|
"\vPortBinding\x12%\n" +
|
|
"\x0econtainer_port\x18\x01 \x01(\rR\rcontainerPort\x12\x1b\n" +
|
|
"\thost_port\x18\x02 \x01(\rR\bhostPort\x12\x1a\n" +
|
|
"\bprotocol\x18\x03 \x01(\tR\bprotocol\"\x81\x01\n" +
|
|
"\rS3UploadCreds\x12*\n" +
|
|
"\x11presigned_put_url\x18\x01 \x01(\tR\x0fpresignedPutUrl\x12\"\n" +
|
|
"\rexpires_at_ms\x18\x02 \x01(\x04R\vexpiresAtMs\x12 \n" +
|
|
"\ffinal_s3_key\x18\x03 \x01(\tR\n" +
|
|
"finalS3Key\"x\n" +
|
|
"\x0fS3DownloadCreds\x12*\n" +
|
|
"\x11presigned_get_url\x18\x01 \x01(\tR\x0fpresignedGetUrl\x12\"\n" +
|
|
"\rexpires_at_ms\x18\x02 \x01(\x04R\vexpiresAtMs\x12\x15\n" +
|
|
"\x06s3_key\x18\x03 \x01(\tR\x05s3Key\"Y\n" +
|
|
"\vRetryPolicy\x12!\n" +
|
|
"\fmax_attempts\x18\x01 \x01(\rR\vmaxAttempts\x12'\n" +
|
|
"\x0fbackoff_seconds\x18\x02 \x03(\rR\x0ebackoffSeconds\"I\n" +
|
|
"\x11MaintenanceWindow\x12\x1b\n" +
|
|
"\tstart_utc\x18\x01 \x01(\tR\bstartUtc\x12\x17\n" +
|
|
"\aend_utc\x18\x02 \x01(\tR\x06endUtc\"\x8b\x01\n" +
|
|
"\x10AdvancedSettings\x12*\n" +
|
|
"\x11max_parallel_jobs\x18\x01 \x01(\rR\x0fmaxParallelJobs\x12\x1b\n" +
|
|
"\tlog_level\x18\x02 \x01(\tR\blogLevel\x12.\n" +
|
|
"\x13auto_update_enabled\x18\x03 \x01(\bR\x11autoUpdateEnabled*h\n" +
|
|
"\tJobStatus\x12\x1a\n" +
|
|
"\x16JOB_STATUS_UNSPECIFIED\x10\x00\x12\n" +
|
|
"\n" +
|
|
"\x06QUEUED\x10\x01\x12\v\n" +
|
|
"\aRUNNING\x10\x02\x12\v\n" +
|
|
"\aSUCCESS\x10\x03\x12\n" +
|
|
"\n" +
|
|
"\x06FAILED\x10\x04\x12\r\n" +
|
|
"\tCANCELLED\x10\x05*h\n" +
|
|
"\x06DbType\x12\x12\n" +
|
|
"\x0eDB_UNSPECIFIED\x10\x00\x12\x0e\n" +
|
|
"\n" +
|
|
"POSTGRESQL\x10\x01\x12\t\n" +
|
|
"\x05MYSQL\x10\x02\x12\v\n" +
|
|
"\aMARIADB\x10\x03\x12\v\n" +
|
|
"\aMONGODB\x10\x04\x12\t\n" +
|
|
"\x05REDIS\x10\x05\x12\n" +
|
|
"\n" +
|
|
"\x06SQLITE\x10\x06*?\n" +
|
|
"\x12ConnectionStrategy\x12\a\n" +
|
|
"\x03TCP\x10\x00\x12\x0f\n" +
|
|
"\vDOCKER_EXEC\x10\x01\x12\x0f\n" +
|
|
"\vUNIX_SOCKET\x10\x02*/\n" +
|
|
"\tCheckType\x12\b\n" +
|
|
"\x04HTTP\x10\x00\x12\t\n" +
|
|
"\x05HTTPS\x10\x01\x12\r\n" +
|
|
"\tTCP_CHECK\x10\x02*?\n" +
|
|
"\bLogLevel\x12\t\n" +
|
|
"\x05TRACE\x10\x00\x12\t\n" +
|
|
"\x05DEBUG\x10\x01\x12\b\n" +
|
|
"\x04INFO\x10\x02\x12\b\n" +
|
|
"\x04WARN\x10\x03\x12\t\n" +
|
|
"\x05ERROR\x10\x04B\xa5\x01\n" +
|
|
"\rcom.backup.v1B\vCommonProtoP\x01ZBgithub.com/backupy/backupy/packages/proto/gen/go/backupv1;backupv1\xa2\x02\x03BXX\xaa\x02\tBackup.V1\xca\x02\tBackup\\V1\xe2\x02\x15Backup\\V1\\GPBMetadata\xea\x02\n" +
|
|
"Backup::V1b\x06proto3"
|
|
|
|
var (
|
|
file_backupv1_common_proto_rawDescOnce sync.Once
|
|
file_backupv1_common_proto_rawDescData []byte
|
|
)
|
|
|
|
func file_backupv1_common_proto_rawDescGZIP() []byte {
|
|
file_backupv1_common_proto_rawDescOnce.Do(func() {
|
|
file_backupv1_common_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_backupv1_common_proto_rawDesc), len(file_backupv1_common_proto_rawDesc)))
|
|
})
|
|
return file_backupv1_common_proto_rawDescData
|
|
}
|
|
|
|
var file_backupv1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 5)
|
|
var file_backupv1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
|
var file_backupv1_common_proto_goTypes = []any{
|
|
(JobStatus)(0), // 0: backup.v1.JobStatus
|
|
(DbType)(0), // 1: backup.v1.DbType
|
|
(ConnectionStrategy)(0), // 2: backup.v1.ConnectionStrategy
|
|
(CheckType)(0), // 3: backup.v1.CheckType
|
|
(LogLevel)(0), // 4: backup.v1.LogLevel
|
|
(*AgentMetrics)(nil), // 5: backup.v1.AgentMetrics
|
|
(*PortBinding)(nil), // 6: backup.v1.PortBinding
|
|
(*S3UploadCreds)(nil), // 7: backup.v1.S3UploadCreds
|
|
(*S3DownloadCreds)(nil), // 8: backup.v1.S3DownloadCreds
|
|
(*RetryPolicy)(nil), // 9: backup.v1.RetryPolicy
|
|
(*MaintenanceWindow)(nil), // 10: backup.v1.MaintenanceWindow
|
|
(*AdvancedSettings)(nil), // 11: backup.v1.AdvancedSettings
|
|
}
|
|
var file_backupv1_common_proto_depIdxs = []int32{
|
|
0, // [0:0] is the sub-list for method output_type
|
|
0, // [0:0] is the sub-list for method input_type
|
|
0, // [0:0] is the sub-list for extension type_name
|
|
0, // [0:0] is the sub-list for extension extendee
|
|
0, // [0:0] is the sub-list for field type_name
|
|
}
|
|
|
|
func init() { file_backupv1_common_proto_init() }
|
|
func file_backupv1_common_proto_init() {
|
|
if File_backupv1_common_proto != nil {
|
|
return
|
|
}
|
|
type x struct{}
|
|
out := protoimpl.TypeBuilder{
|
|
File: protoimpl.DescBuilder{
|
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_backupv1_common_proto_rawDesc), len(file_backupv1_common_proto_rawDesc)),
|
|
NumEnums: 5,
|
|
NumMessages: 7,
|
|
NumExtensions: 0,
|
|
NumServices: 0,
|
|
},
|
|
GoTypes: file_backupv1_common_proto_goTypes,
|
|
DependencyIndexes: file_backupv1_common_proto_depIdxs,
|
|
EnumInfos: file_backupv1_common_proto_enumTypes,
|
|
MessageInfos: file_backupv1_common_proto_msgTypes,
|
|
}.Build()
|
|
File_backupv1_common_proto = out.File
|
|
file_backupv1_common_proto_goTypes = nil
|
|
file_backupv1_common_proto_depIdxs = nil
|
|
}
|