public Task StartBackupAsync(string backupLocation, DatabaseDocument databaseDocument, string databaseName)
        {
            RavenJObject backupSettings;
            var          request = adminRequest.StartBackup(backupLocation, databaseDocument, databaseName, out backupSettings);

            return(request.WriteAsync(backupSettings.ToString(Formatting.None)));
        }
        public Task StartBackupAsync(string backupLocation, DatabaseDocument databaseDocument, bool incremental, string databaseName)
        {
            var request = adminRequest.StartBackup(backupLocation, databaseDocument, databaseName, incremental);

            return(request.WriteAsync(RavenJObject.FromObject(new BackupRequest
            {
                BackupLocation = backupLocation,
                DatabaseDocument = databaseDocument
            })));
        }
Esempio n. 3
0
 public async Task StartBackupAsync(string backupLocation, DatabaseDocument databaseDocument, bool incremental, string databaseName, CancellationToken token = default(CancellationToken))
 {
     using (var request = adminRequest.StartBackup(backupLocation, databaseDocument, databaseName, incremental))
     {
         await request.WriteAsync(RavenJObject.FromObject(new DatabaseBackupRequest
         {
             BackupLocation   = backupLocation,
             DatabaseDocument = databaseDocument
         })).WithCancellation(token).ConfigureAwait(false);
     }
 }
Esempio n. 4
0
        public async Task <Operation> StartBackupAsync(string backupLocation, DatabaseDocument databaseDocument, bool incremental, string databaseName, CancellationToken token = default(CancellationToken))
        {
            using (var request = adminRequest.StartBackup(backupLocation, databaseDocument, databaseName, incremental))
            {
                await request.WriteAsync(RavenJObject.FromObject(new DatabaseBackupRequest
                {
                    BackupLocation   = backupLocation,
                    DatabaseDocument = databaseDocument
                })).WithCancellation(token).ConfigureAwait(false);

                var jsonResponse = await request.ReadResponseJsonAsync().WithCancellation(token).ConfigureAwait(false);

                return(new Operation((AsyncServerClient)innerAsyncServerClient.ForSystemDatabase(), jsonResponse.Value <long>("OperationId")));
            }
        }