mirror of
https://github.com/garethgeorge/backrest.git
synced 2025-12-17 02:55:39 +00:00
103 lines
3.3 KiB
Protocol Buffer
103 lines
3.3 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package v1;
|
|
|
|
option go_package = "github.com/garethgeorge/backrest/gen/go/v1";
|
|
|
|
import "v1/restic.proto";
|
|
import "v1/config.proto";
|
|
|
|
message OperationList {
|
|
repeated Operation operations = 1;
|
|
}
|
|
|
|
message Operation {
|
|
// required, primary ID of the operation. ID is sequential based on creation time of the operation.
|
|
int64 id = 1;
|
|
// required, repo id if associated with a repo
|
|
string repo_id = 2;
|
|
// required, plan id if associated with a plan
|
|
string plan_id = 3;
|
|
// optional snapshot id if associated with a snapshot.
|
|
string snapshot_id = 8;
|
|
OperationStatus status = 4;
|
|
// required, unix time in milliseconds of the operation's creation (ID is derived from this)
|
|
int64 unix_time_start_ms = 5;
|
|
// optional, unix time in milliseconds of the operation's completion
|
|
int64 unix_time_end_ms = 6;
|
|
// optional, human readable context message, typically an error message.
|
|
string display_message = 7;
|
|
|
|
oneof op {
|
|
OperationBackup operation_backup = 100;
|
|
OperationIndexSnapshot operation_index_snapshot = 101;
|
|
OperationForget operation_forget = 102;
|
|
OperationPrune operation_prune = 103;
|
|
OperationRestore operation_restore = 104;
|
|
OperationStats operation_stats = 105;
|
|
OperationRunHook operation_run_hook = 106;
|
|
}
|
|
}
|
|
|
|
// OperationEvent is used in the wireformat to stream operation changes to clients
|
|
message OperationEvent {
|
|
OperationEventType type = 1;
|
|
Operation operation = 2;
|
|
}
|
|
|
|
// OperationEventType indicates whether the operation was created or updated
|
|
enum OperationEventType {
|
|
EVENT_UNKNOWN = 0;
|
|
EVENT_CREATED = 1;
|
|
EVENT_UPDATED = 2;
|
|
EVENT_DELETED = 3;
|
|
}
|
|
|
|
enum OperationStatus {
|
|
STATUS_UNKNOWN = 0; // used to indicate that the status is unknown.
|
|
STATUS_PENDING = 1; // used to indicate that the operation is pending.
|
|
STATUS_INPROGRESS = 2; // used to indicate that the operation is in progress.
|
|
STATUS_SUCCESS = 3; // used to indicate that the operation completed successfully.
|
|
STATUS_WARNING = 7; // used to indicate that the operation completed with warnings.
|
|
STATUS_ERROR = 4; // used to indicate that the operation failed.
|
|
STATUS_SYSTEM_CANCELLED = 5; // indicates operation cancelled by the system.
|
|
STATUS_USER_CANCELLED = 6; // indicates operation cancelled by the user.
|
|
}
|
|
|
|
message OperationBackup {
|
|
BackupProgressEntry last_status = 3;
|
|
}
|
|
|
|
// OperationIndexSnapshot tracks that a snapshot was detected by backrest.
|
|
message OperationIndexSnapshot {
|
|
ResticSnapshot snapshot = 2; // the snapshot that was indexed.
|
|
bool forgot = 3; // tracks whether this snapshot is forgotten yet.
|
|
int64 forgot_by_op = 4; // ID of a forget operation that removed this snapshot.
|
|
}
|
|
|
|
// OperationForget tracks a forget operation.
|
|
message OperationForget {
|
|
repeated ResticSnapshot forget = 1;
|
|
RetentionPolicy policy = 2;
|
|
}
|
|
|
|
// OperationPrune tracks a prune operation.
|
|
message OperationPrune {
|
|
string output = 1; // output of the prune.
|
|
}
|
|
|
|
message OperationRestore {
|
|
string path = 1; // path in the snapshot to restore.
|
|
string target = 2; // location to restore it to.
|
|
RestoreProgressEntry status = 3; // status of the restore.
|
|
}
|
|
|
|
message OperationStats {
|
|
RepoStats stats = 1;
|
|
}
|
|
|
|
message OperationRunHook {
|
|
string name = 1; // description of the hook that was run. typically repo/hook_idx or plan/hook_idx.
|
|
string output_logref = 2; // logref of the hook's output.
|
|
}
|