Add advanced options to backup service (#405)

* Add advanced options for Backup

* Add backup encryption strings

* Add test for backup advanced option

* Add strings to SR

* Add verify backup restore option

* Addressed PR comments

* Add MIT license header
This commit is contained in:
Kate Shin
2017-07-12 13:09:07 -07:00
committed by GitHub
parent 64e671ca2a
commit 414949d129
11 changed files with 450 additions and 125 deletions

View File

@@ -13,11 +13,34 @@ namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery.Contracts
/// </summary>
public class BackupConfigInfo
{
/// <summary>
/// Gets or sets default database info
/// </summary>
public DatabaseInfo DatabaseInfo { get; set; }
/// <summary>
/// Gets or sets recovery model of a database
/// </summary>
public string RecoveryModel { get; set; }
/// <summary>
/// Gets or sets the latest backup set of a database
/// </summary>
public List<RestoreItemSource> LatestBackups { get; set; }
/// <summary>
/// Gets or sets the default backup folder
/// </summary>
public string DefaultBackupFolder { get; set; }
/// <summary>
/// Gets or sets backup encryptors
/// </summary>
public List<BackupEncryptor> BackupEncryptors { get; set; }
/// <summary>
/// Ctor
/// </summary>
public BackupConfigInfo()
{
}

View File

@@ -3,6 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System;
using System.Collections.Generic;
namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery.Contracts
@@ -13,7 +14,7 @@ namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery.Contracts
/// Name of the datbase to perfom backup
/// </summary>
public string DatabaseName { get; set; }
/// <summary>
/// Component to backup - Database or Files
/// </summary>
@@ -48,15 +49,104 @@ namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery.Contracts
/// List of {key: backup path, value: device type}
/// </summary>
public Dictionary<string, int> BackupPathDevices { get; set; }
/// <summary>
/// List of selected backup paths
/// </summary>
public List<string> BackupPathList { get; set; }
/// <summary>
/// Indicates if the backup should be copy-only
/// </summary>
public bool IsCopyOnly { get; set; }
/// <summary>
/// Gets or sets a Boolean property value that determines whether a media is formatted as the first step of the backup operation.
/// </summary>
public bool FormatMedia { get; set; }
/// <summary>
/// Gets or sets a Boolean property value that determines whether the devices associated with a backup operation are initialized as part of the backup operation.
/// </summary>
public bool Initialize { get; set; }
/// <summary>
/// Gets or sets Boolean property that determines whether the tape header is read.
/// </summary>
public bool SkipTapeHeader { get; set; }
/// <summary>
/// Gets or sets the name used to identify a particular media set.
/// </summary>
public string MediaName { get; set; }
/// <summary>
/// Gets or sets a textual description of the medium that contains a backup set.
/// </summary>
public string MediaDescription { get; set; }
/// <summary>
/// Gets or sets a Boolean property value that determines whether a checksum value is calculated during backup or restore operations.
/// </summary>
public bool Checksum { get; set; }
/// <summary>
/// Gets or sets a Boolean property value that determines whether the backup or restore continues after a checksum error occurs.
/// </summary>
public bool ContinueAfterError { get; set; }
/// <summary>
/// Gets or sets a Boolean property value that determines whether to truncate the database log.
/// </summary>
public bool LogTruncation { get; set; }
/// <summary>
/// Gets or sets a Boolean property value that determines whether to backup the tail of the log
/// </summary>
public bool TailLogBackup { get; set; }
/// <summary>
/// Gets or sets a textual description for a particular backup set.
/// </summary>
public string BackupSetDescription { get; set; }
/// <summary>
/// Gets or sets the number of days that must elapse before a backup set can be overwritten.
/// </summary>
public int RetainDays { get; set; }
/// <summary>
/// Gets or sets the date and time when the backup set expires and the backup data is no longer considered relevant.
/// </summary>
public DateTime ExpirationDate { get; set; }
/// <summary>
/// Gets or sets the backup compression option.
/// This should be converted to BackupCompressionOptions when setting it to Backup object.
/// </summary>
public int CompressionOption { get; set; }
/// <summary>
/// Gets or sets a Boolean property that determines whether verify is required.
/// </summary>
public bool VerifyBackupRequired { get; set; }
/// <summary>
/// Specifies the algorithm type used for backup encryption.
/// This should be converted to BackupEncryptionAlgorithm when creating BackupEncryptionOptions object.
/// </summary>
public int EncryptionAlgorithm { get; set; }
/// <summary>
/// Specifies the encryptor type used to encrypt an encryption key.
/// This should be converted to BackupEncryptorType when creating BackupEncryptionOptions object.
/// </summary>
public int EncryptorType { get; set; }
/// <summary>
/// Gets or sets the name of the encryptor.
/// </summary>
public string EncryptorName { get; set; }
}
}