Example #1
0
        /// <summary>
        /// Odeslani reportu o backupu
        /// </summary>
        public async Task PostBackupReport(BackupReport report, List <ErrorDetails> errorDetails)
        {
            string data           = JsonConvert.SerializeObject(report) + "@@border@@" + JsonConvert.SerializeObject(errorDetails);
            string apiDestination = $"api/daemon/{this.daemonId.ToString()}";

            using (var client = GetJsonClient())
            {
                HttpResponseMessage response = await client.PostAsJsonAsync(apiDestination, data);
            }
        }
Example #2
0
        public virtual void SendReport()
        {
            Console.WriteLine("Sending the report");
            BackupReport report = new BackupReport()
            {
                DaemonId = DaemonSettings.Id,
                Date     = DateTime.Now,
                Type     = this.backup.BackupType,
                Size     = this.reportMaker.GetFileSize(),
                BackupId = this.backup.Id,
            };

            this.communicator.PostBackupReport(report, this.reportMaker.GetErrors());
        }