//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System.Collections.Generic;
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery.Contracts
{
///
/// Restore request parameters
///
public class RestoreParams
{
///
/// The Uri to find the connection to do the restore operations
///
public string OwnerUri { get; set; }
///
/// The backup file path
///
public string BackupFilePath { get; set; }
///
/// Database name to restore from (either the back file path or database name can be used for restore operation,
/// If the backup file is set, the database name will be ignored)
///
public string DatabaseName { get; set; }
///
/// If set to true, the db files will be relocated to default data location in the server
///
public bool RelocateDbFiles { get; set; }
}
///
/// Restore response
///
public class RestoreResponse
{
///
/// Indicates if the restore task created successfully
///
public bool Result { get; set; }
///
/// The task id assosiated witht the restore operation
///
public string TaskId { get; set; }
///
/// Errors occurred while creating the restore operation task
///
public string ErrorMessage { get; set; }
}
///
/// Restore Plan Response
///
public class RestorePlanResponse
{
///
/// The backup file path
///
public string BackupFilePath { get; set; }
///
/// Indicates whether the restore operation is supported
///
public bool CanRestore { get; set; }
///
/// Errors occurred while creating restore plan
///
public string ErrorMessage { get; set; }
///
/// The db files included in the backup file
///
public IEnumerable DbFiles { get; set; }
///
/// Server name
///
public string ServerName { get; set; }
///
/// Database name to restore to
///
public string DatabaseName { get; set; }
///
/// Indicates whether relocating the db files is required
/// because the original file paths are not valid in the target server
///
public bool RelocateFilesNeeded { get; set; }
///
/// Default Data folder path in the target server
///
public string DefaultDataFolder { get; set; }
///
/// Default log folder path in the target server
///
public string DefaultLogFolder { get; set; }
}
public class RestoreRequest
{
public static readonly
RequestType Type =
RequestType.Create("disasterrecovery/restore");
}
public class RestorePlanRequest
{
public static readonly
RequestType Type =
RequestType.Create("disasterrecovery/restoreplan");
}
}