diff --git a/internal/types/operation.go b/internal/types/operation.go index 2f824fb8..f5b9966f 100644 --- a/internal/types/operation.go +++ b/internal/types/operation.go @@ -24,6 +24,7 @@ type Operation interface { GetContainerID() string GetType() OperationType SetType(t OperationType) + GetTypeDescription() string GetState() OperationState SetState(s OperationState) GetMessage() string @@ -65,6 +66,9 @@ func (o *TakeBackupOperation) GetType() OperationType { } func (o *TakeBackupOperation) SetType(_ OperationType) { } +func (o *TakeBackupOperation) GetTypeDescription() string { + return "TakeBackupOperation" +} func (o *TakeBackupOperation) GetState() OperationState { return o.State } @@ -148,6 +152,9 @@ func (o *RestoreBackupOperation) GetType() OperationType { } func (o *RestoreBackupOperation) SetType(_ OperationType) { } +func (o *RestoreBackupOperation) GetTypeDescription() string { + return "RestoreBackupOperation" +} func (o *RestoreBackupOperation) GetState() OperationState { return o.State } @@ -222,6 +229,9 @@ func (o *DeleteBackupOperation) GetType() OperationType { } func (o *DeleteBackupOperation) SetType(_ OperationType) { } +func (o *DeleteBackupOperation) GetTypeDescription() string { + return "DeleteBackupOperation" +} func (o *DeleteBackupOperation) GetState() OperationState { return o.State } @@ -298,6 +308,9 @@ func (o *TakeBackupWithRetryOperation) GetState() OperationState { func (o *TakeBackupWithRetryOperation) SetState(s OperationState) { o.State = s } +func (o *TakeBackupWithRetryOperation) GetTypeDescription() string { + return "TakeBackupWithRetryOperation" +} func (o *TakeBackupWithRetryOperation) GetMessage() string { return o.Message } @@ -389,6 +402,9 @@ func (o *GenericOperation) GetType() OperationType { func (o *GenericOperation) SetType(t OperationType) { o.Type = t } +func (o *GenericOperation) GetTypeDescription() string { + return "Undefined" +} func (o *GenericOperation) GetState() OperationState { return o.State } diff --git a/pkg/proto/ydbcp/v1alpha1/operation.pb.go b/pkg/proto/ydbcp/v1alpha1/operation.pb.go index 49743077..f51064d9 100644 --- a/pkg/proto/ydbcp/v1alpha1/operation.pb.go +++ b/pkg/proto/ydbcp/v1alpha1/operation.pb.go @@ -106,6 +106,7 @@ type Operation struct { UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,14,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` ParentOperationId string `protobuf:"bytes,15,opt,name=parent_operation_id,json=parentOperationId,proto3" json:"parent_operation_id,omitempty"` RetryConfig *RetryConfig `protobuf:"bytes,16,opt,name=retry_config,json=retryConfig,proto3" json:"retry_config,omitempty"` + TypeDescription string `protobuf:"bytes,17,opt,name=type_description,json=typeDescription,proto3" json:"type_description,omitempty"` } func (x *Operation) Reset() { @@ -250,6 +251,13 @@ func (x *Operation) GetRetryConfig() *RetryConfig { return nil } +func (x *Operation) GetTypeDescription() string { + if x != nil { + return x.TypeDescription + } + return "" +} + var File_ydbcp_v1alpha1_operation_proto protoreflect.FileDescriptor var file_ydbcp_v1alpha1_operation_proto_rawDesc = []byte{ @@ -261,7 +269,7 @@ var file_ydbcp_v1alpha1_operation_proto_rawDesc = []byte{ 0x64, 0x62, 0x63, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x74, 0x72, 0x79, 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, 0xad, 0x06, 0x0a, 0x09, 0x4f, + 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd8, 0x06, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, @@ -304,20 +312,22 @@ var file_ydbcp_v1alpha1_operation_proto_rawDesc = []byte{ 0x6e, 0x66, 0x69, 0x67, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x74, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0b, 0x72, 0x65, 0x74, 0x72, 0x79, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x22, 0x83, 0x01, 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, 0x08, 0x0a, 0x04, 0x44, 0x4f, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x09, - 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x41, 0x4e, - 0x43, 0x45, 0x4c, 0x4c, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x41, 0x4e, - 0x43, 0x45, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x52, 0x54, - 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x49, 0x4e, 0x47, 0x10, 0x06, 0x12, 0x0b, 0x0a, - 0x07, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x07, 0x42, 0x3e, 0x5a, 0x3c, 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, 0x2f, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x3b, 0x79, 0x64, 0x62, 0x63, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x6e, 0x66, 0x69, 0x67, 0x12, 0x29, 0x0a, 0x10, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, + 0x74, 0x79, 0x70, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x83, 0x01, 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, + 0x08, 0x0a, 0x04, 0x44, 0x4f, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, + 0x4f, 0x52, 0x10, 0x03, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x49, + 0x4e, 0x47, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x45, 0x44, + 0x10, 0x05, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x43, 0x41, 0x4e, 0x43, + 0x45, 0x4c, 0x4c, 0x49, 0x4e, 0x47, 0x10, 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x55, 0x4e, 0x4e, + 0x49, 0x4e, 0x47, 0x10, 0x07, 0x42, 0x3e, 0x5a, 0x3c, 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, + 0x2f, 0x79, 0x64, 0x62, 0x63, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, + 0x79, 0x64, 0x62, 0x63, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/proto/ydbcp/v1alpha1/operation.proto b/pkg/proto/ydbcp/v1alpha1/operation.proto index 30b1f1a6..28467b5f 100644 --- a/pkg/proto/ydbcp/v1alpha1/operation.proto +++ b/pkg/proto/ydbcp/v1alpha1/operation.proto @@ -52,4 +52,6 @@ message Operation { string parent_operation_id = 15; // Retry configuration for the operation. RetryConfig retry_config = 16; + // Human readable description for the operation type. + string type_description = 17; } \ No newline at end of file