From 2b30c5dbf5c82137d9c8463d43e541d230b9818b Mon Sep 17 00:00:00 2001 From: Aleksei Pleshakov Date: Fri, 26 Jul 2024 19:33:16 +0300 Subject: [PATCH] BackupSchedules api draft --- pkg/proto/ydbcp/v1alpha1/backup.pb.go | 75 ++- pkg/proto/ydbcp/v1alpha1/backup.proto | 1 + .../ydbcp/v1alpha1/backup_schedule.pb.go | 557 +++++++++++++++++ .../ydbcp/v1alpha1/backup_schedule.proto | 47 ++ .../v1alpha1/backup_schedule_service.pb.go | 584 ++++++++++++++++++ .../v1alpha1/backup_schedule_service.proto | 67 ++ .../backup_schedule_service_grpc.pb.go | 257 ++++++++ pkg/proto/ydbcp/v1alpha1/backup_service.pb.go | 4 +- .../ydbcp/v1alpha1/backup_service_grpc.pb.go | 2 +- 9 files changed, 1559 insertions(+), 35 deletions(-) create mode 100644 pkg/proto/ydbcp/v1alpha1/backup_schedule.pb.go create mode 100644 pkg/proto/ydbcp/v1alpha1/backup_schedule.proto create mode 100644 pkg/proto/ydbcp/v1alpha1/backup_schedule_service.pb.go create mode 100644 pkg/proto/ydbcp/v1alpha1/backup_schedule_service.proto create mode 100644 pkg/proto/ydbcp/v1alpha1/backup_schedule_service_grpc.pb.go diff --git a/pkg/proto/ydbcp/v1alpha1/backup.pb.go b/pkg/proto/ydbcp/v1alpha1/backup.pb.go index 27321a51..a4964e94 100644 --- a/pkg/proto/ydbcp/v1alpha1/backup.pb.go +++ b/pkg/proto/ydbcp/v1alpha1/backup.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 -// protoc v5.27.1 +// protoc-gen-go v1.34.1 +// protoc v4.25.1 // source: ydbcp/v1alpha1/backup.proto package ydbcp @@ -94,6 +94,7 @@ type Backup struct { Status Backup_Status `protobuf:"varint,8,opt,name=status,proto3,enum=ydbcp.v1alpha1.Backup_Status" json:"status,omitempty"` Message string `protobuf:"bytes,9,opt,name=message,proto3" json:"message,omitempty"` ExpireAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=expire_at,json=expireAt,proto3" json:"expire_at,omitempty"` + ScheduleId string `protobuf:"bytes,11,opt,name=schedule_id,json=scheduleId,proto3" json:"schedule_id,omitempty"` } func (x *Backup) Reset() { @@ -198,6 +199,13 @@ func (x *Backup) GetExpireAt() *timestamppb.Timestamp { return nil } +func (x *Backup) GetScheduleId() string { + if x != nil { + return x.ScheduleId + } + return "" +} + type S3Location struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -339,8 +347,8 @@ var file_ydbcp_v1alpha1_backup_proto_rawDesc = []byte{ 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf9, - 0x03, 0x0a, 0x06, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, + 0x04, 0x0a, 0x06, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, @@ -365,34 +373,37 @@ var file_ydbcp_v1alpha1_backup_proto_rawDesc = []byte{ 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x65, 0x78, 0x70, - 0x69, 0x72, 0x65, 0x41, 0x74, 0x22, 0x63, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x45, 0x4e, 0x44, 0x49, - 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x56, 0x41, 0x49, 0x4c, 0x41, 0x42, 0x4c, - 0x45, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x12, 0x0d, - 0x0a, 0x09, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x04, 0x12, 0x0b, 0x0a, - 0x07, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x05, 0x22, 0x79, 0x0a, 0x0a, 0x53, 0x33, - 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, - 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, - 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, - 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, - 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x70, 0x72, 0x65, - 0x66, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x74, 0x68, 0x50, - 0x72, 0x65, 0x66, 0x69, 0x78, 0x22, 0x9f, 0x01, 0x0a, 0x09, 0x41, 0x75, 0x64, 0x69, 0x74, 0x49, - 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x39, 0x0a, - 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3d, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x70, - 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, - 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x64, 0x62, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x2f, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x3b, 0x79, 0x64, 0x62, 0x63, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x72, 0x65, 0x41, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x63, 0x68, 0x65, + 0x64, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x22, 0x63, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x45, 0x4e, 0x44, + 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x56, 0x41, 0x49, 0x4c, 0x41, 0x42, + 0x4c, 0x45, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x12, + 0x0d, 0x0a, 0x09, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x04, 0x12, 0x0b, + 0x0a, 0x07, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x05, 0x22, 0x79, 0x0a, 0x0a, 0x53, + 0x33, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, + 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x70, 0x72, + 0x65, 0x66, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x74, 0x68, + 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x22, 0x9f, 0x01, 0x0a, 0x09, 0x41, 0x75, 0x64, 0x69, 0x74, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x39, + 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3d, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, + 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x63, 0x6f, 0x6d, + 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x64, 0x62, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x2f, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x3b, 0x79, 0x64, 0x62, 0x63, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/pkg/proto/ydbcp/v1alpha1/backup.proto b/pkg/proto/ydbcp/v1alpha1/backup.proto index 56a993f6..50049c50 100644 --- a/pkg/proto/ydbcp/v1alpha1/backup.proto +++ b/pkg/proto/ydbcp/v1alpha1/backup.proto @@ -24,6 +24,7 @@ message Backup { Status status = 8; string message = 9; google.protobuf.Timestamp expire_at = 10; + string schedule_id = 11; } message S3Location { diff --git a/pkg/proto/ydbcp/v1alpha1/backup_schedule.pb.go b/pkg/proto/ydbcp/v1alpha1/backup_schedule.pb.go new file mode 100644 index 00000000..da5bbc10 --- /dev/null +++ b/pkg/proto/ydbcp/v1alpha1/backup_schedule.pb.go @@ -0,0 +1,557 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v4.25.1 +// source: ydbcp/v1alpha1/backup_schedule.proto + +package ydbcp + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +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) +) + +type BackupSchedulePattern struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Crontab string `protobuf:"bytes,1,opt,name=crontab,proto3" json:"crontab,omitempty"` +} + +func (x *BackupSchedulePattern) Reset() { + *x = BackupSchedulePattern{} + if protoimpl.UnsafeEnabled { + mi := &file_ydbcp_v1alpha1_backup_schedule_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BackupSchedulePattern) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BackupSchedulePattern) ProtoMessage() {} + +func (x *BackupSchedulePattern) ProtoReflect() protoreflect.Message { + mi := &file_ydbcp_v1alpha1_backup_schedule_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BackupSchedulePattern.ProtoReflect.Descriptor instead. +func (*BackupSchedulePattern) Descriptor() ([]byte, []int) { + return file_ydbcp_v1alpha1_backup_schedule_proto_rawDescGZIP(), []int{0} +} + +func (x *BackupSchedulePattern) GetCrontab() string { + if x != nil { + return x.Crontab + } + return "" +} + +type BackupScheduleSettings struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SchedulePattern *BackupSchedulePattern `protobuf:"bytes,1,opt,name=schedule_pattern,json=schedulePattern,proto3" json:"schedule_pattern,omitempty"` + Ttl *durationpb.Duration `protobuf:"bytes,2,opt,name=ttl,proto3" json:"ttl,omitempty"` + RecoveryPointObjective *durationpb.Duration `protobuf:"bytes,3,opt,name=recovery_point_objective,json=recoveryPointObjective,proto3" json:"recovery_point_objective,omitempty"` +} + +func (x *BackupScheduleSettings) Reset() { + *x = BackupScheduleSettings{} + if protoimpl.UnsafeEnabled { + mi := &file_ydbcp_v1alpha1_backup_schedule_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BackupScheduleSettings) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BackupScheduleSettings) ProtoMessage() {} + +func (x *BackupScheduleSettings) ProtoReflect() protoreflect.Message { + mi := &file_ydbcp_v1alpha1_backup_schedule_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BackupScheduleSettings.ProtoReflect.Descriptor instead. +func (*BackupScheduleSettings) Descriptor() ([]byte, []int) { + return file_ydbcp_v1alpha1_backup_schedule_proto_rawDescGZIP(), []int{1} +} + +func (x *BackupScheduleSettings) GetSchedulePattern() *BackupSchedulePattern { + if x != nil { + return x.SchedulePattern + } + return nil +} + +func (x *BackupScheduleSettings) GetTtl() *durationpb.Duration { + if x != nil { + return x.Ttl + } + return nil +} + +func (x *BackupScheduleSettings) GetRecoveryPointObjective() *durationpb.Duration { + if x != nil { + return x.RecoveryPointObjective + } + return nil +} + +type ScheduledBackupInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BackupId string `protobuf:"bytes,1,opt,name=backup_id,json=backupId,proto3" json:"backup_id,omitempty"` + RecoveryPoint *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=recovery_point,json=recoveryPoint,proto3" json:"recovery_point,omitempty"` + LastBackupRpoMarginInterval *durationpb.Duration `protobuf:"bytes,3,opt,name=last_backup_rpo_margin_interval,json=lastBackupRpoMarginInterval,proto3" json:"last_backup_rpo_margin_interval,omitempty"` + LastBackupRpoMarginPercent float32 `protobuf:"fixed32,4,opt,name=last_backup_rpo_margin_percent,json=lastBackupRpoMarginPercent,proto3" json:"last_backup_rpo_margin_percent,omitempty"` +} + +func (x *ScheduledBackupInfo) Reset() { + *x = ScheduledBackupInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_ydbcp_v1alpha1_backup_schedule_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ScheduledBackupInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduledBackupInfo) ProtoMessage() {} + +func (x *ScheduledBackupInfo) ProtoReflect() protoreflect.Message { + mi := &file_ydbcp_v1alpha1_backup_schedule_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScheduledBackupInfo.ProtoReflect.Descriptor instead. +func (*ScheduledBackupInfo) Descriptor() ([]byte, []int) { + return file_ydbcp_v1alpha1_backup_schedule_proto_rawDescGZIP(), []int{2} +} + +func (x *ScheduledBackupInfo) GetBackupId() string { + if x != nil { + return x.BackupId + } + return "" +} + +func (x *ScheduledBackupInfo) GetRecoveryPoint() *timestamppb.Timestamp { + if x != nil { + return x.RecoveryPoint + } + return nil +} + +func (x *ScheduledBackupInfo) GetLastBackupRpoMarginInterval() *durationpb.Duration { + if x != nil { + return x.LastBackupRpoMarginInterval + } + return nil +} + +func (x *ScheduledBackupInfo) GetLastBackupRpoMarginPercent() float32 { + if x != nil { + return x.LastBackupRpoMarginPercent + } + return 0 +} + +type BackupSchedule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // backup settings + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ContainerId string `protobuf:"bytes,2,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + DatabaseName string `protobuf:"bytes,3,opt,name=database_name,json=databaseName,proto3" json:"database_name,omitempty"` + Endpoint string `protobuf:"bytes,4,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + SourcePaths []string `protobuf:"bytes,5,rep,name=source_paths,json=sourcePaths,proto3" json:"source_paths,omitempty"` // [(size) = "<=256"]; + SourcePathsToExclude []string `protobuf:"bytes,6,rep,name=source_paths_to_exclude,json=sourcePathsToExclude,proto3" json:"source_paths_to_exclude,omitempty"` // [(size) = "<=256"]; + Location *S3Location `protobuf:"bytes,7,opt,name=location,proto3" json:"location,omitempty"` + Audit *AuditInfo `protobuf:"bytes,8,opt,name=audit,proto3" json:"audit,omitempty"` + ScheduleName string `protobuf:"bytes,9,opt,name=schedule_name,json=scheduleName,proto3" json:"schedule_name,omitempty"` + Active bool `protobuf:"varint,10,opt,name=active,proto3" json:"active,omitempty"` + ScheduleSettings *BackupScheduleSettings `protobuf:"bytes,11,opt,name=schedule_settings,json=scheduleSettings,proto3" json:"schedule_settings,omitempty"` + NextLaunch *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=next_launch,json=nextLaunch,proto3" json:"next_launch,omitempty"` + LastSuccessfulBackupInfo *ScheduledBackupInfo `protobuf:"bytes,13,opt,name=last_successful_backup_info,json=lastSuccessfulBackupInfo,proto3" json:"last_successful_backup_info,omitempty"` +} + +func (x *BackupSchedule) Reset() { + *x = BackupSchedule{} + if protoimpl.UnsafeEnabled { + mi := &file_ydbcp_v1alpha1_backup_schedule_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BackupSchedule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BackupSchedule) ProtoMessage() {} + +func (x *BackupSchedule) ProtoReflect() protoreflect.Message { + mi := &file_ydbcp_v1alpha1_backup_schedule_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BackupSchedule.ProtoReflect.Descriptor instead. +func (*BackupSchedule) Descriptor() ([]byte, []int) { + return file_ydbcp_v1alpha1_backup_schedule_proto_rawDescGZIP(), []int{3} +} + +func (x *BackupSchedule) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *BackupSchedule) GetContainerId() string { + if x != nil { + return x.ContainerId + } + return "" +} + +func (x *BackupSchedule) GetDatabaseName() string { + if x != nil { + return x.DatabaseName + } + return "" +} + +func (x *BackupSchedule) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *BackupSchedule) GetSourcePaths() []string { + if x != nil { + return x.SourcePaths + } + return nil +} + +func (x *BackupSchedule) GetSourcePathsToExclude() []string { + if x != nil { + return x.SourcePathsToExclude + } + return nil +} + +func (x *BackupSchedule) GetLocation() *S3Location { + if x != nil { + return x.Location + } + return nil +} + +func (x *BackupSchedule) GetAudit() *AuditInfo { + if x != nil { + return x.Audit + } + return nil +} + +func (x *BackupSchedule) GetScheduleName() string { + if x != nil { + return x.ScheduleName + } + return "" +} + +func (x *BackupSchedule) GetActive() bool { + if x != nil { + return x.Active + } + return false +} + +func (x *BackupSchedule) GetScheduleSettings() *BackupScheduleSettings { + if x != nil { + return x.ScheduleSettings + } + return nil +} + +func (x *BackupSchedule) GetNextLaunch() *timestamppb.Timestamp { + if x != nil { + return x.NextLaunch + } + return nil +} + +func (x *BackupSchedule) GetLastSuccessfulBackupInfo() *ScheduledBackupInfo { + if x != nil { + return x.LastSuccessfulBackupInfo + } + return nil +} + +var File_ydbcp_v1alpha1_backup_schedule_proto protoreflect.FileDescriptor + +var file_ydbcp_v1alpha1_backup_schedule_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x79, 0x64, 0x62, 0x63, 0x70, 0x1a, 0x1b, 0x79, + 0x64, 0x62, 0x63, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x61, + 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x31, 0x0a, 0x15, 0x42, + 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x61, 0x74, + 0x74, 0x65, 0x72, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x6f, 0x6e, 0x74, 0x61, 0x62, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x6f, 0x6e, 0x74, 0x61, 0x62, 0x22, 0xe3, + 0x01, 0x0a, 0x16, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x47, 0x0a, 0x10, 0x73, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2e, 0x42, 0x61, 0x63, 0x6b, + 0x75, 0x70, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, + 0x6e, 0x52, 0x0f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x74, 0x65, + 0x72, 0x6e, 0x12, 0x2b, 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x74, 0x74, 0x6c, 0x12, + 0x53, 0x0a, 0x18, 0x72, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x5f, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x16, 0x72, 0x65, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x22, 0x9a, 0x02, 0x0a, 0x13, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, 0x0a, 0x09, + 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x49, 0x64, 0x12, 0x41, 0x0a, 0x0e, 0x72, 0x65, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x79, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0d, 0x72, + 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x5f, 0x0a, 0x1f, + 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x72, 0x70, 0x6f, 0x5f, + 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x1b, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x70, 0x6f, 0x4d, + 0x61, 0x72, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x42, 0x0a, + 0x1e, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x72, 0x70, 0x6f, + 0x5f, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x1a, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, + 0x70, 0x52, 0x70, 0x6f, 0x4d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, + 0x74, 0x22, 0xe8, 0x04, 0x0a, 0x0e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x63, 0x68, 0x65, + 0x64, 0x75, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x62, + 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, + 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x61, 0x74, 0x68, 0x73, 0x12, 0x35, 0x0a, 0x17, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, + 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x50, 0x61, 0x74, 0x68, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x63, 0x6c, 0x75, + 0x64, 0x65, 0x12, 0x36, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x33, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x05, 0x61, 0x75, + 0x64, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x79, 0x64, 0x62, 0x63, + 0x70, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x75, 0x64, 0x69, 0x74, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x61, 0x75, 0x64, 0x69, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x73, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x4a, 0x0a, 0x11, 0x73, 0x63, 0x68, 0x65, + 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2e, 0x42, 0x61, 0x63, 0x6b, + 0x75, 0x70, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x73, 0x52, 0x10, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x53, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x6c, 0x61, 0x75, + 0x6e, 0x63, 0x68, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6e, 0x65, 0x78, 0x74, 0x4c, 0x61, 0x75, 0x6e, 0x63, + 0x68, 0x12, 0x59, 0x0a, 0x1b, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x66, 0x75, 0x6c, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x69, 0x6e, 0x66, 0x6f, + 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2e, 0x53, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x18, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, + 0x75, 0x6c, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x2f, 0x5a, 0x2d, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x64, 0x62, 0x2d, 0x70, + 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2f, 0x70, 0x6b, + 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x79, 0x64, 0x62, 0x63, 0x70, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_ydbcp_v1alpha1_backup_schedule_proto_rawDescOnce sync.Once + file_ydbcp_v1alpha1_backup_schedule_proto_rawDescData = file_ydbcp_v1alpha1_backup_schedule_proto_rawDesc +) + +func file_ydbcp_v1alpha1_backup_schedule_proto_rawDescGZIP() []byte { + file_ydbcp_v1alpha1_backup_schedule_proto_rawDescOnce.Do(func() { + file_ydbcp_v1alpha1_backup_schedule_proto_rawDescData = protoimpl.X.CompressGZIP(file_ydbcp_v1alpha1_backup_schedule_proto_rawDescData) + }) + return file_ydbcp_v1alpha1_backup_schedule_proto_rawDescData +} + +var file_ydbcp_v1alpha1_backup_schedule_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_ydbcp_v1alpha1_backup_schedule_proto_goTypes = []interface{}{ + (*BackupSchedulePattern)(nil), // 0: ydbcp.BackupSchedulePattern + (*BackupScheduleSettings)(nil), // 1: ydbcp.BackupScheduleSettings + (*ScheduledBackupInfo)(nil), // 2: ydbcp.ScheduledBackupInfo + (*BackupSchedule)(nil), // 3: ydbcp.BackupSchedule + (*durationpb.Duration)(nil), // 4: google.protobuf.Duration + (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp + (*S3Location)(nil), // 6: ydbcp.v1alpha1.S3Location + (*AuditInfo)(nil), // 7: ydbcp.v1alpha1.AuditInfo +} +var file_ydbcp_v1alpha1_backup_schedule_proto_depIdxs = []int32{ + 0, // 0: ydbcp.BackupScheduleSettings.schedule_pattern:type_name -> ydbcp.BackupSchedulePattern + 4, // 1: ydbcp.BackupScheduleSettings.ttl:type_name -> google.protobuf.Duration + 4, // 2: ydbcp.BackupScheduleSettings.recovery_point_objective:type_name -> google.protobuf.Duration + 5, // 3: ydbcp.ScheduledBackupInfo.recovery_point:type_name -> google.protobuf.Timestamp + 4, // 4: ydbcp.ScheduledBackupInfo.last_backup_rpo_margin_interval:type_name -> google.protobuf.Duration + 6, // 5: ydbcp.BackupSchedule.location:type_name -> ydbcp.v1alpha1.S3Location + 7, // 6: ydbcp.BackupSchedule.audit:type_name -> ydbcp.v1alpha1.AuditInfo + 1, // 7: ydbcp.BackupSchedule.schedule_settings:type_name -> ydbcp.BackupScheduleSettings + 5, // 8: ydbcp.BackupSchedule.next_launch:type_name -> google.protobuf.Timestamp + 2, // 9: ydbcp.BackupSchedule.last_successful_backup_info:type_name -> ydbcp.ScheduledBackupInfo + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_ydbcp_v1alpha1_backup_schedule_proto_init() } +func file_ydbcp_v1alpha1_backup_schedule_proto_init() { + if File_ydbcp_v1alpha1_backup_schedule_proto != nil { + return + } + file_ydbcp_v1alpha1_backup_proto_init() + if !protoimpl.UnsafeEnabled { + file_ydbcp_v1alpha1_backup_schedule_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BackupSchedulePattern); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ydbcp_v1alpha1_backup_schedule_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BackupScheduleSettings); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ydbcp_v1alpha1_backup_schedule_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ScheduledBackupInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ydbcp_v1alpha1_backup_schedule_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BackupSchedule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ydbcp_v1alpha1_backup_schedule_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ydbcp_v1alpha1_backup_schedule_proto_goTypes, + DependencyIndexes: file_ydbcp_v1alpha1_backup_schedule_proto_depIdxs, + MessageInfos: file_ydbcp_v1alpha1_backup_schedule_proto_msgTypes, + }.Build() + File_ydbcp_v1alpha1_backup_schedule_proto = out.File + file_ydbcp_v1alpha1_backup_schedule_proto_rawDesc = nil + file_ydbcp_v1alpha1_backup_schedule_proto_goTypes = nil + file_ydbcp_v1alpha1_backup_schedule_proto_depIdxs = nil +} diff --git a/pkg/proto/ydbcp/v1alpha1/backup_schedule.proto b/pkg/proto/ydbcp/v1alpha1/backup_schedule.proto new file mode 100644 index 00000000..959e50ff --- /dev/null +++ b/pkg/proto/ydbcp/v1alpha1/backup_schedule.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; + +package ydbcp; +option go_package = "github.com/ydb-platform/ydbcp/pkg/proto;ydbcp"; + +import "ydbcp/v1alpha1/backup.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + + +message BackupSchedulePattern { + string crontab = 1; +} + +message BackupScheduleSettings { + BackupSchedulePattern schedule_pattern = 1; + google.protobuf.Duration ttl = 2; + google.protobuf.Duration recovery_point_objective = 3; +} + +message ScheduledBackupInfo { + string backup_id = 1; + google.protobuf.Timestamp recovery_point = 2; + google.protobuf.Duration last_backup_rpo_margin_interval = 3; + float last_backup_rpo_margin_percent = 4; +} + +message BackupSchedule { + //backup settings + string id = 1; + string container_id = 2; + string database_name = 3; + string endpoint = 4; + repeated string source_paths = 5; // [(size) = "<=256"]; + repeated string source_paths_to_exclude = 6; // [(size) = "<=256"]; + + ydbcp.v1alpha1.AuditInfo audit = 7; + + string schedule_name = 8; + bool active = 9; + + BackupScheduleSettings schedule_settings = 10; + + google.protobuf.Timestamp next_launch = 11; + + ScheduledBackupInfo last_successful_backup_info = 12; +} diff --git a/pkg/proto/ydbcp/v1alpha1/backup_schedule_service.pb.go b/pkg/proto/ydbcp/v1alpha1/backup_schedule_service.pb.go new file mode 100644 index 00000000..44eeeecc --- /dev/null +++ b/pkg/proto/ydbcp/v1alpha1/backup_schedule_service.pb.go @@ -0,0 +1,584 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v4.25.1 +// source: ydbcp/v1alpha1/backup_schedule_service.proto + +package ydbcp + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" +) + +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) +) + +type SetBackupScheduleRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // optional id to create new schedule or update existing one + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // fields of MakeBackupRequest to schedule + ContainerId string `protobuf:"bytes,2,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + DatabaseName string `protobuf:"bytes,3,opt,name=database_name,json=databaseName,proto3" json:"database_name,omitempty"` + Endpoint string `protobuf:"bytes,4,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + SourcePaths []string `protobuf:"bytes,5,rep,name=source_paths,json=sourcePaths,proto3" json:"source_paths,omitempty"` // [(size) = "<=256"]; + SourcePathsToExclude []string `protobuf:"bytes,6,rep,name=source_paths_to_exclude,json=sourcePathsToExclude,proto3" json:"source_paths_to_exclude,omitempty"` // [(size) = "<=256"]; + ScheduleName string `protobuf:"bytes,7,opt,name=schedule_name,json=scheduleName,proto3" json:"schedule_name,omitempty"` + ScheduleSettings *BackupScheduleSettings `protobuf:"bytes,8,opt,name=schedule_settings,json=scheduleSettings,proto3" json:"schedule_settings,omitempty"` +} + +func (x *SetBackupScheduleRequest) Reset() { + *x = SetBackupScheduleRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ydbcp_v1alpha1_backup_schedule_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetBackupScheduleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetBackupScheduleRequest) ProtoMessage() {} + +func (x *SetBackupScheduleRequest) ProtoReflect() protoreflect.Message { + mi := &file_ydbcp_v1alpha1_backup_schedule_service_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetBackupScheduleRequest.ProtoReflect.Descriptor instead. +func (*SetBackupScheduleRequest) Descriptor() ([]byte, []int) { + return file_ydbcp_v1alpha1_backup_schedule_service_proto_rawDescGZIP(), []int{0} +} + +func (x *SetBackupScheduleRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *SetBackupScheduleRequest) GetContainerId() string { + if x != nil { + return x.ContainerId + } + return "" +} + +func (x *SetBackupScheduleRequest) GetDatabaseName() string { + if x != nil { + return x.DatabaseName + } + return "" +} + +func (x *SetBackupScheduleRequest) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *SetBackupScheduleRequest) GetSourcePaths() []string { + if x != nil { + return x.SourcePaths + } + return nil +} + +func (x *SetBackupScheduleRequest) GetSourcePathsToExclude() []string { + if x != nil { + return x.SourcePathsToExclude + } + return nil +} + +func (x *SetBackupScheduleRequest) GetScheduleName() string { + if x != nil { + return x.ScheduleName + } + return "" +} + +func (x *SetBackupScheduleRequest) GetScheduleSettings() *BackupScheduleSettings { + if x != nil { + return x.ScheduleSettings + } + return nil +} + +type ListBackupSchedulesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + DatabaseNameMask string `protobuf:"bytes,2,opt,name=database_name_mask,json=databaseNameMask,proto3" json:"database_name_mask,omitempty"` + // The maximum number of results per page that should be returned. If the number of available + // results is larger than `page_size`, the service returns a `next_page_token` that can be used + // to get the next page of results in subsequent ListBackupSchedules requests. + // Acceptable values are 0 to 1000, inclusive. Default value: 100. + PageSize uint32 `protobuf:"varint,1000,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // [(value) = "0-1000"]; + // Page token. Set `page_token` to the `next_page_token` returned by a previous ListBackups + // request to get the next page of results. + PageToken string `protobuf:"bytes,1001,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` // [(length) = "<=100"]; +} + +func (x *ListBackupSchedulesRequest) Reset() { + *x = ListBackupSchedulesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ydbcp_v1alpha1_backup_schedule_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListBackupSchedulesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBackupSchedulesRequest) ProtoMessage() {} + +func (x *ListBackupSchedulesRequest) ProtoReflect() protoreflect.Message { + mi := &file_ydbcp_v1alpha1_backup_schedule_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListBackupSchedulesRequest.ProtoReflect.Descriptor instead. +func (*ListBackupSchedulesRequest) Descriptor() ([]byte, []int) { + return file_ydbcp_v1alpha1_backup_schedule_service_proto_rawDescGZIP(), []int{1} +} + +func (x *ListBackupSchedulesRequest) GetContainerId() string { + if x != nil { + return x.ContainerId + } + return "" +} + +func (x *ListBackupSchedulesRequest) GetDatabaseNameMask() string { + if x != nil { + return x.DatabaseNameMask + } + return "" +} + +func (x *ListBackupSchedulesRequest) GetPageSize() uint32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListBackupSchedulesRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +type ListBackupSchedulesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Schedules []*BackupSchedule `protobuf:"bytes,1,rep,name=schedules,proto3" json:"schedules,omitempty"` + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` +} + +func (x *ListBackupSchedulesResponse) Reset() { + *x = ListBackupSchedulesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ydbcp_v1alpha1_backup_schedule_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListBackupSchedulesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBackupSchedulesResponse) ProtoMessage() {} + +func (x *ListBackupSchedulesResponse) ProtoReflect() protoreflect.Message { + mi := &file_ydbcp_v1alpha1_backup_schedule_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListBackupSchedulesResponse.ProtoReflect.Descriptor instead. +func (*ListBackupSchedulesResponse) Descriptor() ([]byte, []int) { + return file_ydbcp_v1alpha1_backup_schedule_service_proto_rawDescGZIP(), []int{2} +} + +func (x *ListBackupSchedulesResponse) GetSchedules() []*BackupSchedule { + if x != nil { + return x.Schedules + } + return nil +} + +func (x *ListBackupSchedulesResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +type GetBackupScheduleRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetBackupScheduleRequest) Reset() { + *x = GetBackupScheduleRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ydbcp_v1alpha1_backup_schedule_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBackupScheduleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBackupScheduleRequest) ProtoMessage() {} + +func (x *GetBackupScheduleRequest) ProtoReflect() protoreflect.Message { + mi := &file_ydbcp_v1alpha1_backup_schedule_service_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBackupScheduleRequest.ProtoReflect.Descriptor instead. +func (*GetBackupScheduleRequest) Descriptor() ([]byte, []int) { + return file_ydbcp_v1alpha1_backup_schedule_service_proto_rawDescGZIP(), []int{3} +} + +func (x *GetBackupScheduleRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type ToggleBackupScheduleRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ActiveState bool `protobuf:"varint,2,opt,name=active_state,json=activeState,proto3" json:"active_state,omitempty"` +} + +func (x *ToggleBackupScheduleRequest) Reset() { + *x = ToggleBackupScheduleRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ydbcp_v1alpha1_backup_schedule_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ToggleBackupScheduleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ToggleBackupScheduleRequest) ProtoMessage() {} + +func (x *ToggleBackupScheduleRequest) ProtoReflect() protoreflect.Message { + mi := &file_ydbcp_v1alpha1_backup_schedule_service_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ToggleBackupScheduleRequest.ProtoReflect.Descriptor instead. +func (*ToggleBackupScheduleRequest) Descriptor() ([]byte, []int) { + return file_ydbcp_v1alpha1_backup_schedule_service_proto_rawDescGZIP(), []int{4} +} + +func (x *ToggleBackupScheduleRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ToggleBackupScheduleRequest) GetActiveState() bool { + if x != nil { + return x.ActiveState + } + return false +} + +var File_ydbcp_v1alpha1_backup_schedule_service_proto protoreflect.FileDescriptor + +var file_ydbcp_v1alpha1_backup_schedule_service_proto_rawDesc = []byte{ + 0x0a, 0x2c, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, + 0x79, 0x64, 0x62, 0x63, 0x70, 0x1a, 0x24, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2f, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x73, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd9, 0x02, 0x0a, 0x18, + 0x53, 0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x64, + 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x61, 0x74, 0x68, 0x73, 0x12, + 0x35, 0x0a, 0x17, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x73, 0x5f, + 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x14, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x61, 0x74, 0x68, 0x73, 0x54, 0x6f, 0x45, + 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, + 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x4a, 0x0a, 0x11, 0x73, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2e, 0x42, + 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x53, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x10, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x53, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0xab, 0x01, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, + 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x12, 0x64, 0x61, 0x74, + 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, + 0x61, 0x6d, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, + 0x73, 0x69, 0x7a, 0x65, 0x18, 0xe8, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, + 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0xe9, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x7a, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2e, + 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x09, + 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, + 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x22, 0x2a, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x63, + 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x50, 0x0a, + 0x1b, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, + 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x32, + 0xbb, 0x03, 0x0a, 0x15, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, + 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4b, 0x0a, 0x11, 0x53, 0x65, 0x74, + 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1f, + 0x2e, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2e, 0x53, 0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, + 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x15, 0x2e, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x63, + 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x4b, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x42, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1f, 0x2e, 0x79, 0x64, + 0x62, 0x63, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x79, + 0x64, 0x62, 0x63, 0x70, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x12, 0x5c, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, + 0x70, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x21, 0x2e, 0x79, 0x64, 0x62, + 0x63, 0x70, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, + 0x79, 0x64, 0x62, 0x63, 0x70, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, + 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x53, 0x0a, 0x16, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x79, 0x64, + 0x62, 0x63, 0x70, 0x2e, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, + 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x15, 0x2e, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x63, + 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x55, 0x0a, 0x18, 0x44, 0x65, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, + 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2e, 0x54, 0x6f, 0x67, 0x67, 0x6c, + 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2e, 0x42, + 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x42, 0x2f, 0x5a, + 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x64, 0x62, 0x2d, + 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2f, 0x70, + 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x79, 0x64, 0x62, 0x63, 0x70, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_ydbcp_v1alpha1_backup_schedule_service_proto_rawDescOnce sync.Once + file_ydbcp_v1alpha1_backup_schedule_service_proto_rawDescData = file_ydbcp_v1alpha1_backup_schedule_service_proto_rawDesc +) + +func file_ydbcp_v1alpha1_backup_schedule_service_proto_rawDescGZIP() []byte { + file_ydbcp_v1alpha1_backup_schedule_service_proto_rawDescOnce.Do(func() { + file_ydbcp_v1alpha1_backup_schedule_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_ydbcp_v1alpha1_backup_schedule_service_proto_rawDescData) + }) + return file_ydbcp_v1alpha1_backup_schedule_service_proto_rawDescData +} + +var file_ydbcp_v1alpha1_backup_schedule_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_ydbcp_v1alpha1_backup_schedule_service_proto_goTypes = []interface{}{ + (*SetBackupScheduleRequest)(nil), // 0: ydbcp.SetBackupScheduleRequest + (*ListBackupSchedulesRequest)(nil), // 1: ydbcp.ListBackupSchedulesRequest + (*ListBackupSchedulesResponse)(nil), // 2: ydbcp.ListBackupSchedulesResponse + (*GetBackupScheduleRequest)(nil), // 3: ydbcp.GetBackupScheduleRequest + (*ToggleBackupScheduleRequest)(nil), // 4: ydbcp.ToggleBackupScheduleRequest + (*BackupScheduleSettings)(nil), // 5: ydbcp.BackupScheduleSettings + (*BackupSchedule)(nil), // 6: ydbcp.BackupSchedule +} +var file_ydbcp_v1alpha1_backup_schedule_service_proto_depIdxs = []int32{ + 5, // 0: ydbcp.SetBackupScheduleRequest.schedule_settings:type_name -> ydbcp.BackupScheduleSettings + 6, // 1: ydbcp.ListBackupSchedulesResponse.schedules:type_name -> ydbcp.BackupSchedule + 0, // 2: ydbcp.BackupScheduleService.SetBackupSchedule:input_type -> ydbcp.SetBackupScheduleRequest + 3, // 3: ydbcp.BackupScheduleService.GetBackupSchedule:input_type -> ydbcp.GetBackupScheduleRequest + 1, // 4: ydbcp.BackupScheduleService.ListBackupSchedules:input_type -> ydbcp.ListBackupSchedulesRequest + 4, // 5: ydbcp.BackupScheduleService.ActivateBackupSchedule:input_type -> ydbcp.ToggleBackupScheduleRequest + 4, // 6: ydbcp.BackupScheduleService.DeactivateBackupSchedule:input_type -> ydbcp.ToggleBackupScheduleRequest + 6, // 7: ydbcp.BackupScheduleService.SetBackupSchedule:output_type -> ydbcp.BackupSchedule + 6, // 8: ydbcp.BackupScheduleService.GetBackupSchedule:output_type -> ydbcp.BackupSchedule + 2, // 9: ydbcp.BackupScheduleService.ListBackupSchedules:output_type -> ydbcp.ListBackupSchedulesResponse + 6, // 10: ydbcp.BackupScheduleService.ActivateBackupSchedule:output_type -> ydbcp.BackupSchedule + 6, // 11: ydbcp.BackupScheduleService.DeactivateBackupSchedule:output_type -> ydbcp.BackupSchedule + 7, // [7:12] is the sub-list for method output_type + 2, // [2:7] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_ydbcp_v1alpha1_backup_schedule_service_proto_init() } +func file_ydbcp_v1alpha1_backup_schedule_service_proto_init() { + if File_ydbcp_v1alpha1_backup_schedule_service_proto != nil { + return + } + file_ydbcp_v1alpha1_backup_schedule_proto_init() + if !protoimpl.UnsafeEnabled { + file_ydbcp_v1alpha1_backup_schedule_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetBackupScheduleRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ydbcp_v1alpha1_backup_schedule_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListBackupSchedulesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ydbcp_v1alpha1_backup_schedule_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListBackupSchedulesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ydbcp_v1alpha1_backup_schedule_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBackupScheduleRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ydbcp_v1alpha1_backup_schedule_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ToggleBackupScheduleRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ydbcp_v1alpha1_backup_schedule_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_ydbcp_v1alpha1_backup_schedule_service_proto_goTypes, + DependencyIndexes: file_ydbcp_v1alpha1_backup_schedule_service_proto_depIdxs, + MessageInfos: file_ydbcp_v1alpha1_backup_schedule_service_proto_msgTypes, + }.Build() + File_ydbcp_v1alpha1_backup_schedule_service_proto = out.File + file_ydbcp_v1alpha1_backup_schedule_service_proto_rawDesc = nil + file_ydbcp_v1alpha1_backup_schedule_service_proto_goTypes = nil + file_ydbcp_v1alpha1_backup_schedule_service_proto_depIdxs = nil +} diff --git a/pkg/proto/ydbcp/v1alpha1/backup_schedule_service.proto b/pkg/proto/ydbcp/v1alpha1/backup_schedule_service.proto new file mode 100644 index 00000000..864bc59c --- /dev/null +++ b/pkg/proto/ydbcp/v1alpha1/backup_schedule_service.proto @@ -0,0 +1,67 @@ +syntax = "proto3"; + +package ydbcp; +option go_package = "github.com/ydb-platform/ydbcp/pkg/proto;ydbcp"; + +import "ydbcp/v1alpha1/backup_schedule.proto"; +import "google/protobuf/duration.proto"; + +service BackupScheduleService { + rpc CreateBackupSchedule (CreateBackupScheduleRequest) returns (BackupSchedule); + rpc UpdateBackupSchedule (UpdateBackupScheduleRequest) returns (BackupSchedule); + rpc GetBackupSchedule (GetBackupScheduleRequest) returns (BackupSchedule); + rpc ListBackupSchedules (ListBackupSchedulesRequest) returns (ListBackupSchedulesResponse); + rpc ToggleBackupSchedule (ToggleBackupScheduleRequest) returns (BackupSchedule); +} + +message CreateBackupScheduleRequest { + //fields of MakeBackupRequest to schedule + string container_id = 1; + string database_name = 2; + string endpoint = 3; + repeated string source_paths = 4; // [(size) = "<=256"]; + repeated string source_paths_to_exclude = 5; // [(size) = "<=256"]; + + string schedule_name = 6; + BackupScheduleSettings schedule_settings = 7; +} + +message UpdateBackupScheduleRequest { + string id = 1; + //fields of MakeBackupRequest to schedule + repeated string source_paths = 2; // [(size) = "<=256"]; + repeated string source_paths_to_exclude = 3; // [(size) = "<=256"]; + + string schedule_name = 4; + BackupScheduleSettings schedule_settings = 5; +} + + +message ListBackupSchedulesRequest { + string container_id = 1; + string database_name_mask = 2; + + // The maximum number of results per page that should be returned. If the number of available + // results is larger than `page_size`, the service returns a `next_page_token` that can be used + // to get the next page of results in subsequent ListBackupSchedules requests. + // Acceptable values are 0 to 1000, inclusive. Default value: 100. + uint32 page_size = 1000; // [(value) = "0-1000"]; + + // Page token. Set `page_token` to the `next_page_token` returned by a previous ListBackups + // request to get the next page of results. + string page_token = 1001; // [(length) = "<=100"]; +} + +message ListBackupSchedulesResponse { + repeated BackupSchedule schedules = 1; + string next_page_token = 2; +} + +message GetBackupScheduleRequest { + string id = 1; +} + +message ToggleBackupScheduleRequest { + string id = 1; + bool active_state = 2; +} diff --git a/pkg/proto/ydbcp/v1alpha1/backup_schedule_service_grpc.pb.go b/pkg/proto/ydbcp/v1alpha1/backup_schedule_service_grpc.pb.go new file mode 100644 index 00000000..5f11e515 --- /dev/null +++ b/pkg/proto/ydbcp/v1alpha1/backup_schedule_service_grpc.pb.go @@ -0,0 +1,257 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.1 +// source: ydbcp/v1alpha1/backup_schedule_service.proto + +package ydbcp + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + BackupScheduleService_SetBackupSchedule_FullMethodName = "/ydbcp.BackupScheduleService/SetBackupSchedule" + BackupScheduleService_GetBackupSchedule_FullMethodName = "/ydbcp.BackupScheduleService/GetBackupSchedule" + BackupScheduleService_ListBackupSchedules_FullMethodName = "/ydbcp.BackupScheduleService/ListBackupSchedules" + BackupScheduleService_ActivateBackupSchedule_FullMethodName = "/ydbcp.BackupScheduleService/ActivateBackupSchedule" + BackupScheduleService_DeactivateBackupSchedule_FullMethodName = "/ydbcp.BackupScheduleService/DeactivateBackupSchedule" +) + +// BackupScheduleServiceClient is the client API for BackupScheduleService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type BackupScheduleServiceClient interface { + SetBackupSchedule(ctx context.Context, in *SetBackupScheduleRequest, opts ...grpc.CallOption) (*BackupSchedule, error) + GetBackupSchedule(ctx context.Context, in *GetBackupScheduleRequest, opts ...grpc.CallOption) (*BackupSchedule, error) + ListBackupSchedules(ctx context.Context, in *ListBackupSchedulesRequest, opts ...grpc.CallOption) (*ListBackupSchedulesResponse, error) + ActivateBackupSchedule(ctx context.Context, in *ToggleBackupScheduleRequest, opts ...grpc.CallOption) (*BackupSchedule, error) + DeactivateBackupSchedule(ctx context.Context, in *ToggleBackupScheduleRequest, opts ...grpc.CallOption) (*BackupSchedule, error) +} + +type backupScheduleServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewBackupScheduleServiceClient(cc grpc.ClientConnInterface) BackupScheduleServiceClient { + return &backupScheduleServiceClient{cc} +} + +func (c *backupScheduleServiceClient) SetBackupSchedule(ctx context.Context, in *SetBackupScheduleRequest, opts ...grpc.CallOption) (*BackupSchedule, error) { + out := new(BackupSchedule) + err := c.cc.Invoke(ctx, BackupScheduleService_SetBackupSchedule_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *backupScheduleServiceClient) GetBackupSchedule(ctx context.Context, in *GetBackupScheduleRequest, opts ...grpc.CallOption) (*BackupSchedule, error) { + out := new(BackupSchedule) + err := c.cc.Invoke(ctx, BackupScheduleService_GetBackupSchedule_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *backupScheduleServiceClient) ListBackupSchedules(ctx context.Context, in *ListBackupSchedulesRequest, opts ...grpc.CallOption) (*ListBackupSchedulesResponse, error) { + out := new(ListBackupSchedulesResponse) + err := c.cc.Invoke(ctx, BackupScheduleService_ListBackupSchedules_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *backupScheduleServiceClient) ActivateBackupSchedule(ctx context.Context, in *ToggleBackupScheduleRequest, opts ...grpc.CallOption) (*BackupSchedule, error) { + out := new(BackupSchedule) + err := c.cc.Invoke(ctx, BackupScheduleService_ActivateBackupSchedule_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *backupScheduleServiceClient) DeactivateBackupSchedule(ctx context.Context, in *ToggleBackupScheduleRequest, opts ...grpc.CallOption) (*BackupSchedule, error) { + out := new(BackupSchedule) + err := c.cc.Invoke(ctx, BackupScheduleService_DeactivateBackupSchedule_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// BackupScheduleServiceServer is the server API for BackupScheduleService service. +// All implementations must embed UnimplementedBackupScheduleServiceServer +// for forward compatibility +type BackupScheduleServiceServer interface { + SetBackupSchedule(context.Context, *SetBackupScheduleRequest) (*BackupSchedule, error) + GetBackupSchedule(context.Context, *GetBackupScheduleRequest) (*BackupSchedule, error) + ListBackupSchedules(context.Context, *ListBackupSchedulesRequest) (*ListBackupSchedulesResponse, error) + ActivateBackupSchedule(context.Context, *ToggleBackupScheduleRequest) (*BackupSchedule, error) + DeactivateBackupSchedule(context.Context, *ToggleBackupScheduleRequest) (*BackupSchedule, error) + mustEmbedUnimplementedBackupScheduleServiceServer() +} + +// UnimplementedBackupScheduleServiceServer must be embedded to have forward compatible implementations. +type UnimplementedBackupScheduleServiceServer struct { +} + +func (UnimplementedBackupScheduleServiceServer) SetBackupSchedule(context.Context, *SetBackupScheduleRequest) (*BackupSchedule, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetBackupSchedule not implemented") +} +func (UnimplementedBackupScheduleServiceServer) GetBackupSchedule(context.Context, *GetBackupScheduleRequest) (*BackupSchedule, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBackupSchedule not implemented") +} +func (UnimplementedBackupScheduleServiceServer) ListBackupSchedules(context.Context, *ListBackupSchedulesRequest) (*ListBackupSchedulesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListBackupSchedules not implemented") +} +func (UnimplementedBackupScheduleServiceServer) ActivateBackupSchedule(context.Context, *ToggleBackupScheduleRequest) (*BackupSchedule, error) { + return nil, status.Errorf(codes.Unimplemented, "method ActivateBackupSchedule not implemented") +} +func (UnimplementedBackupScheduleServiceServer) DeactivateBackupSchedule(context.Context, *ToggleBackupScheduleRequest) (*BackupSchedule, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeactivateBackupSchedule not implemented") +} +func (UnimplementedBackupScheduleServiceServer) mustEmbedUnimplementedBackupScheduleServiceServer() {} + +// UnsafeBackupScheduleServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to BackupScheduleServiceServer will +// result in compilation errors. +type UnsafeBackupScheduleServiceServer interface { + mustEmbedUnimplementedBackupScheduleServiceServer() +} + +func RegisterBackupScheduleServiceServer(s grpc.ServiceRegistrar, srv BackupScheduleServiceServer) { + s.RegisterService(&BackupScheduleService_ServiceDesc, srv) +} + +func _BackupScheduleService_SetBackupSchedule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetBackupScheduleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BackupScheduleServiceServer).SetBackupSchedule(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BackupScheduleService_SetBackupSchedule_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BackupScheduleServiceServer).SetBackupSchedule(ctx, req.(*SetBackupScheduleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BackupScheduleService_GetBackupSchedule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBackupScheduleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BackupScheduleServiceServer).GetBackupSchedule(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BackupScheduleService_GetBackupSchedule_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BackupScheduleServiceServer).GetBackupSchedule(ctx, req.(*GetBackupScheduleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BackupScheduleService_ListBackupSchedules_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListBackupSchedulesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BackupScheduleServiceServer).ListBackupSchedules(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BackupScheduleService_ListBackupSchedules_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BackupScheduleServiceServer).ListBackupSchedules(ctx, req.(*ListBackupSchedulesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BackupScheduleService_ActivateBackupSchedule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ToggleBackupScheduleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BackupScheduleServiceServer).ActivateBackupSchedule(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BackupScheduleService_ActivateBackupSchedule_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BackupScheduleServiceServer).ActivateBackupSchedule(ctx, req.(*ToggleBackupScheduleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BackupScheduleService_DeactivateBackupSchedule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ToggleBackupScheduleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BackupScheduleServiceServer).DeactivateBackupSchedule(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BackupScheduleService_DeactivateBackupSchedule_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BackupScheduleServiceServer).DeactivateBackupSchedule(ctx, req.(*ToggleBackupScheduleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// BackupScheduleService_ServiceDesc is the grpc.ServiceDesc for BackupScheduleService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var BackupScheduleService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "ydbcp.BackupScheduleService", + HandlerType: (*BackupScheduleServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SetBackupSchedule", + Handler: _BackupScheduleService_SetBackupSchedule_Handler, + }, + { + MethodName: "GetBackupSchedule", + Handler: _BackupScheduleService_GetBackupSchedule_Handler, + }, + { + MethodName: "ListBackupSchedules", + Handler: _BackupScheduleService_ListBackupSchedules_Handler, + }, + { + MethodName: "ActivateBackupSchedule", + Handler: _BackupScheduleService_ActivateBackupSchedule_Handler, + }, + { + MethodName: "DeactivateBackupSchedule", + Handler: _BackupScheduleService_DeactivateBackupSchedule_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ydbcp/v1alpha1/backup_schedule_service.proto", +} diff --git a/pkg/proto/ydbcp/v1alpha1/backup_service.pb.go b/pkg/proto/ydbcp/v1alpha1/backup_service.pb.go index 84fd746e..fbbd8d2a 100644 --- a/pkg/proto/ydbcp/v1alpha1/backup_service.pb.go +++ b/pkg/proto/ydbcp/v1alpha1/backup_service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 -// protoc v5.27.1 +// protoc-gen-go v1.34.1 +// protoc v4.25.1 // source: ydbcp/v1alpha1/backup_service.proto package ydbcp diff --git a/pkg/proto/ydbcp/v1alpha1/backup_service_grpc.pb.go b/pkg/proto/ydbcp/v1alpha1/backup_service_grpc.pb.go index 8fa79bab..855362ac 100644 --- a/pkg/proto/ydbcp/v1alpha1/backup_service_grpc.pb.go +++ b/pkg/proto/ydbcp/v1alpha1/backup_service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v5.27.1 +// - protoc v4.25.1 // source: ydbcp/v1alpha1/backup_service.proto package ydbcp