diff --git a/common/proto/backup.proto b/common/proto/backup.proto index 38bebdad..181e44bc 100644 --- a/common/proto/backup.proto +++ b/common/proto/backup.proto @@ -8,8 +8,6 @@ service BackupService { rpc StartCheck(komp_ac.common.Empty) returns (BackupOperationResponse); rpc GetBackupInfo(komp_ac.common.Empty) returns (BackupInfoResponse); rpc GetOperationStatus(GetOperationStatusRequest) returns (BackupOperationResponse); - rpc RestoreLatest(RestoreLatestRequest) returns (BackupOperationResponse); - rpc RestoreTarget(RestoreTargetRequest) returns (BackupOperationResponse); } enum BackupType { @@ -23,7 +21,6 @@ enum OperationKind { OPERATION_KIND_UNSPECIFIED = 0; OPERATION_KIND_BACKUP = 1; OPERATION_KIND_CHECK = 2; - OPERATION_KIND_RESTORE = 3; } enum OperationStatus { @@ -37,16 +34,6 @@ message StartBackupRequest { BackupType backup_type = 1; } -message RestoreLatestRequest { - string confirmation = 1; -} - -message RestoreTargetRequest { - string confirmation = 1; - string target_type = 2; - string target = 3; -} - message GetOperationStatusRequest { string operation_id = 1; } diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index 469176c6..457b8c20 100644 Binary files a/common/src/proto/descriptor.bin and b/common/src/proto/descriptor.bin differ diff --git a/common/src/proto/komp_ac.backup.rs b/common/src/proto/komp_ac.backup.rs index 7582e4e5..702553e3 100644 --- a/common/src/proto/komp_ac.backup.rs +++ b/common/src/proto/komp_ac.backup.rs @@ -5,20 +5,6 @@ pub struct StartBackupRequest { pub backup_type: i32, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] -pub struct RestoreLatestRequest { - #[prost(string, tag = "1")] - pub confirmation: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] -pub struct RestoreTargetRequest { - #[prost(string, tag = "1")] - pub confirmation: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub target_type: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub target: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetOperationStatusRequest { #[prost(string, tag = "1")] pub operation_id: ::prost::alloc::string::String, @@ -85,7 +71,6 @@ pub enum OperationKind { Unspecified = 0, Backup = 1, Check = 2, - Restore = 3, } impl OperationKind { /// String value of the enum field names used in the ProtoBuf definition. @@ -97,7 +82,6 @@ impl OperationKind { Self::Unspecified => "OPERATION_KIND_UNSPECIFIED", Self::Backup => "OPERATION_KIND_BACKUP", Self::Check => "OPERATION_KIND_CHECK", - Self::Restore => "OPERATION_KIND_RESTORE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -106,7 +90,6 @@ impl OperationKind { "OPERATION_KIND_UNSPECIFIED" => Some(Self::Unspecified), "OPERATION_KIND_BACKUP" => Some(Self::Backup), "OPERATION_KIND_CHECK" => Some(Self::Check), - "OPERATION_KIND_RESTORE" => Some(Self::Restore), _ => None, } } @@ -334,58 +317,6 @@ pub mod backup_service_client { ); self.inner.unary(req, path, codec).await } - pub async fn restore_latest( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic_prost::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/komp_ac.backup.BackupService/RestoreLatest", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("komp_ac.backup.BackupService", "RestoreLatest"), - ); - self.inner.unary(req, path, codec).await - } - pub async fn restore_target( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic_prost::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/komp_ac.backup.BackupService/RestoreTarget", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("komp_ac.backup.BackupService", "RestoreTarget"), - ); - self.inner.unary(req, path, codec).await - } } } /// Generated server implementations. @@ -429,20 +360,6 @@ pub mod backup_service_server { tonic::Response, tonic::Status, >; - async fn restore_latest( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn restore_target( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; } #[derive(Debug)] pub struct BackupServiceServer { @@ -701,96 +618,6 @@ pub mod backup_service_server { }; Box::pin(fut) } - "/komp_ac.backup.BackupService/RestoreLatest" => { - #[allow(non_camel_case_types)] - struct RestoreLatestSvc(pub Arc); - impl< - T: BackupService, - > tonic::server::UnaryService - for RestoreLatestSvc { - type Response = super::BackupOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::restore_latest(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = RestoreLatestSvc(inner); - let codec = tonic_prost::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/komp_ac.backup.BackupService/RestoreTarget" => { - #[allow(non_camel_case_types)] - struct RestoreTargetSvc(pub Arc); - impl< - T: BackupService, - > tonic::server::UnaryService - for RestoreTargetSvc { - type Response = super::BackupOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::restore_target(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = RestoreTargetSvc(inner); - let codec = tonic_prost::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } _ => { Box::pin(async move { let mut response = http::Response::new( diff --git a/server b/server index 068cfbdb..8eedcdfa 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 068cfbdba058645ae7035abc586a31a0f2dbf493 +Subproject commit 8eedcdfa344c7029e391a2665b0078c8ccead5b5