File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import BackupRestorer from './backupRestorer.js';
77export  type  Backend  =  'filesystem'  |  's3'  |  'gcs'  |  'azure' ; 
88export  type  BackupStatus  =  'STARTED'  |  'TRANSFERRING'  |  'TRANSFERRED'  |  'SUCCESS'  |  'FAILED' ; 
99export  type  BackupCompressionLevel  =  'DefaultCompression'  |  'BestSpeed'  |  'BestCompression' ; 
10+ export  type  BackupListOrder  =  'asc'  |  'desc' ; 
1011
1112export  interface  Backup  { 
1213  creator : ( )  =>  BackupCreator ; 
Original file line number Diff line number Diff line change 22  Backend , 
33  BackupCreateStatusGetter , 
44  BackupCreator , 
5+   BackupListOrder , 
56  BackupRestoreStatusGetter , 
67  BackupRestorer , 
78}  from  '../../backup/index.js' ; 
@@ -205,8 +206,12 @@ export const backup = (connection: Connection): Backup => {
205206          } 
206207        : parseResponse ( res ) ; 
207208    } , 
208-     list : ( backend : Backend ) : Promise < BackupReturn [ ] >  =>  { 
209-       return  connection . get < BackupReturn [ ] > ( `/backups/${ backend }  ` ) ; 
209+     list : ( backend : Backend ,  order ?: BackupListOrder ) : Promise < BackupReturn [ ] >  =>  { 
210+       let  url  =  `/backups/${ backend }  ` ; 
211+       if  ( order )  { 
212+         url  +=  `?order=${ order }  ` ; 
213+       } 
214+       return  connection . get < BackupReturn [ ] > ( url ) ; 
210215    } , 
211216  } ; 
212217} ; 
@@ -261,7 +266,8 @@ export interface Backup {
261266  /** List existing backups (completed and in-progress) created in a given backend. 
262267   * 
263268   * @param  {Backend } backend Backend whence to list backups. 
269+    * @param  {BackupListOrder } [order] Order in which to list backups. 
264270   * @returns  {Promise<BackupReturn[]> } The response from Weaviate. 
265271   * */ 
266-   list ( backend : Backend ) : Promise < BackupReturn [ ] > ; 
272+   list ( backend : Backend ,   order ?:  BackupListOrder ) : Promise < BackupReturn [ ] > ; 
267273} 
Original file line number Diff line number Diff line change @@ -21,6 +21,12 @@ export type BackupReturn = BackupStatusReturn & {
2121  backend : Backend ; 
2222  /** The collections that were included in the backup */ 
2323  collections : string [ ] ; 
24+   /** Timestamp when the backup process started  */ 
25+   startedAt ?: Date ; 
26+   /** Timestamp when the backup process completed (successfully or with failure) */ 
27+   completedAt ?: Date ; 
28+   /** Size of the backup in Gibs */ 
29+   size ?: number ; 
2430} ; 
2531
2632/** Configuration options available when creating a backup */ 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments