server pg backup
This commit is contained in:
67
common/proto/backup.proto
Normal file
67
common/proto/backup.proto
Normal file
@@ -0,0 +1,67 @@
|
||||
syntax = "proto3";
|
||||
package komp_ac.backup;
|
||||
|
||||
import "common.proto";
|
||||
|
||||
service BackupService {
|
||||
rpc StartBackup(StartBackupRequest) returns (BackupOperationResponse);
|
||||
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 {
|
||||
BACKUP_TYPE_UNSPECIFIED = 0;
|
||||
BACKUP_TYPE_FULL = 1;
|
||||
BACKUP_TYPE_DIFF = 2;
|
||||
BACKUP_TYPE_INCR = 3;
|
||||
}
|
||||
|
||||
enum OperationKind {
|
||||
OPERATION_KIND_UNSPECIFIED = 0;
|
||||
OPERATION_KIND_BACKUP = 1;
|
||||
OPERATION_KIND_CHECK = 2;
|
||||
OPERATION_KIND_RESTORE = 3;
|
||||
}
|
||||
|
||||
enum OperationStatus {
|
||||
OPERATION_STATUS_UNSPECIFIED = 0;
|
||||
OPERATION_STATUS_RUNNING = 1;
|
||||
OPERATION_STATUS_SUCCEEDED = 2;
|
||||
OPERATION_STATUS_FAILED = 3;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
message BackupOperationResponse {
|
||||
string operation_id = 1;
|
||||
OperationKind kind = 2;
|
||||
OperationStatus status = 3;
|
||||
string message = 4;
|
||||
string output = 5;
|
||||
int64 started_at_unix_seconds = 6;
|
||||
int64 finished_at_unix_seconds = 7;
|
||||
}
|
||||
|
||||
message BackupInfoResponse {
|
||||
bool success = 1;
|
||||
string output = 2;
|
||||
}
|
||||
Reference in New Issue
Block a user