feat(backup): 实例备份第1轮——独立备份库迁移、settings 仓库路径字段、备份进度事件
This commit is contained in:
1 parent
95a3e00b03
commit
e91ba2ae74
11 files changed
+298
-1
No files matched your search
@@ -248,6 +248,57 @@ pub enum InstanceBulkUpdateProgressStage {
|
||||
Finishing,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Clone)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct InstanceBackupProgressPayload {
|
||||
pub operation_id: Uuid,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub instance_id: Option<String>,
|
||||
pub operation_type: InstanceBackupOperationType,
|
||||
pub stage: InstanceBackupProgressStage,
|
||||
pub processed_bytes: u64,
|
||||
pub total_bytes: u64,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub final_state: Option<InstanceBackupOperationFinalState>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub snapshot_id: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub message: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Clone, Copy)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum InstanceBackupOperationType {
|
||||
Create,
|
||||
Restore,
|
||||
Delete,
|
||||
RepositoryMove,
|
||||
RestorePreview,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Clone, Copy)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum InstanceBackupOperationFinalState {
|
||||
Completed,
|
||||
Cancelled,
|
||||
Failed,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Clone)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum InstanceBackupProgressStage {
|
||||
Scanning,
|
||||
Hashing,
|
||||
Saving,
|
||||
Validating,
|
||||
Copying,
|
||||
Restoring,
|
||||
Deleting,
|
||||
Completed,
|
||||
Cancelled,
|
||||
Failed,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
#[serde(tag = "event")]
|
||||
pub enum CommandPayload {
|
||||
|
||||
Reference in new issue
Block a user