Exemple #1
0
        private static CopyItem CreateJob(string sourceAccountToken, string destinationAccountToken, string sourceContainer, string destinationContainer, bool isIncremental, TextWriter log)
        {
            string job = "Full Backup, Account: " + sourceAccountToken + ", Source Container: " + sourceContainer + ", Destination Container: " + destinationContainer;

            // Create CopyItem object, pass it to WebJobs queue
            CopyItem copyitem = new CopyItem(job, sourceAccountToken, destinationAccountToken, sourceContainer, destinationContainer, isIncremental);

            // Log Job Creation
            log.WriteLine("Create Job: " + job);

            return copyitem;
        }
        private static CopyItem CreateJob(string jobName, string sourceAccountToken, string destinationAccountToken, string sourceContainer, string sourceDirectory, string destinationContainer, string destinationDirectory, bool isIncremental, TextWriter log)
        {
            string jobId = Guid.NewGuid().ToString();

            // Create CopyItem object, pass it to WebJobs queue
            CopyItem copyitem = new CopyItem(jobId, jobName, sourceAccountToken, destinationAccountToken, sourceContainer, sourceDirectory, destinationContainer, destinationDirectory, isIncremental);

            // Log Job Creation
            StringBuilder message = new StringBuilder();
            message.AppendLine("Queued Job: " + jobName);
            message.AppendLine("Source Account: " + sourceAccountToken);
            message.AppendLine("Source Container: " + sourceContainer);
            message.AppendLine("Destination Container: " + destinationContainer);
            message.AppendLine("");

            log.WriteLine(message);

            return copyitem;
        }