File tree Expand file tree Collapse file tree 11 files changed +642
-77
lines changed Expand file tree Collapse file tree 11 files changed +642
-77
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ fn load_config(config: &PathBuf) -> Result<CertBotConfig> {
121121 let renew_timeout = Duration :: from_secs ( config. renew_timeout ) ;
122122 let bot_config = CertBotConfig :: builder ( )
123123 . acme_url ( config. acme_url )
124- . cert_dir ( workdir. backup_dir ( ) )
124+ . cert_dir ( workdir. cert_backup_dir ( ) )
125125 . cert_file ( workdir. cert_path ( ) )
126126 . key_file ( workdir. key_path ( ) )
127127 . auto_create_account ( true )
Original file line number Diff line number Diff line change @@ -27,24 +27,24 @@ impl WorkDir {
2727 self . workdir . join ( "credentials.json" )
2828 }
2929
30- pub fn backup_dir ( & self ) -> PathBuf {
30+ pub fn cert_backup_dir ( & self ) -> PathBuf {
3131 self . workdir . join ( "backup" )
3232 }
3333
34- pub fn live_dir ( & self ) -> PathBuf {
34+ pub fn cert_live_dir ( & self ) -> PathBuf {
3535 self . workdir . join ( "live" )
3636 }
3737
3838 pub fn cert_path ( & self ) -> PathBuf {
39- self . live_dir ( ) . join ( "cert.pem" )
39+ self . cert_live_dir ( ) . join ( "cert.pem" )
4040 }
4141
4242 pub fn key_path ( & self ) -> PathBuf {
43- self . live_dir ( ) . join ( "key.pem" )
43+ self . cert_live_dir ( ) . join ( "key.pem" )
4444 }
4545
4646 pub fn list_certs ( & self ) -> Result < Vec < PathBuf > > {
47- crate :: bot:: list_certs ( self . backup_dir ( ) )
47+ crate :: bot:: list_certs ( self . cert_backup_dir ( ) )
4848 }
4949
5050 pub fn acme_account_uri ( & self ) -> Result < String > {
@@ -58,6 +58,6 @@ impl WorkDir {
5858 }
5959
6060 pub fn list_cert_public_keys ( & self ) -> Result < BTreeSet < Vec < u8 > > > {
61- crate :: bot:: list_cert_public_keys ( self . backup_dir ( ) )
61+ crate :: bot:: list_cert_public_keys ( self . cert_backup_dir ( ) )
6262 }
6363}
Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ impl CertbotConfig {
210210 let workdir = certbot:: WorkDir :: new ( & self . workdir ) ;
211211 certbot:: CertBotConfig :: builder ( )
212212 . auto_create_account ( true )
213- . cert_dir ( workdir. backup_dir ( ) )
213+ . cert_dir ( workdir. cert_backup_dir ( ) )
214214 . cert_file ( workdir. cert_path ( ) )
215215 . key_file ( workdir. key_path ( ) )
216216 . credentials_file ( workdir. account_credentials_path ( ) )
Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ hex_fmt.workspace = true
4444lspci.workspace = true
4545base64.workspace = true
4646serde-human-bytes.workspace = true
47+ serde-duration.workspace = true
48+ chrono.workspace = true
4749
4850[dev-dependencies ]
4951insta.workspace = true
Original file line number Diff line number Diff line change @@ -225,23 +225,39 @@ message GpuInfo {
225225
226226message BackupDiskRequest {
227227 // vm id
228- string id = 1 ;
228+ string vm_id = 1 ;
229229 // full or incremental
230230 string level = 2 ;
231231}
232232
233233message BackupInfo {
234- // filename (e.g., FULL-1694222400-hd1.img)
235- string filename = 1 ;
234+ // Group id
235+ string backup_id = 1 ;
236+ // id of the snapshot
237+ string snapshot_id = 2 ;
238+ // timestamp
239+ string timestamp = 3 ;
240+ // level: full or incremental
241+ string level = 4 ;
236242 // size of the backup in bytes
237- uint64 size = 2 ;
243+ uint64 size = 5 ;
238244}
239245
240246message ListBackupsResponse {
241- // list of backups
242247 repeated BackupInfo backups = 1 ;
243248}
244249
250+ message DeleteBackupRequest {
251+ string vm_id = 1 ;
252+ string backup_id = 2 ;
253+ }
254+
255+ message RestoreBackupRequest {
256+ string vm_id = 1 ;
257+ string backup_id = 2 ;
258+ string snapshot_id = 3 ;
259+ }
260+
245261// Service definition for dstack-vmm
246262service Vmm {
247263 // RPC to create a VM
@@ -286,4 +302,10 @@ service Vmm {
286302
287303 // List backups for a VM
288304 rpc ListBackups (Id ) returns (ListBackupsResponse );
305+
306+ // Delete a backup
307+ rpc DeleteBackup (DeleteBackupRequest ) returns (google .protobuf .Empty );
308+
309+ // Restore a backup
310+ rpc RestoreBackup (RestoreBackupRequest ) returns (google .protobuf .Empty );
289311}
You can’t perform that action at this time.
0 commit comments