Skip to content

Users/sisi/mercury infra #381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ public enum ContainerType
/// <summary>
/// Represents any Azure Storage containers.
/// </summary>
AzureStorage
AzureStorage,

/// <summary>
/// Represents Azure Workload
/// </summary>
AzureWorkload
}

/// <summary>
Expand Down Expand Up @@ -70,6 +75,11 @@ public enum BackupManagementType
/// Represents Azure File Storage. https://docs.microsoft.com/en-in/azure/storage/files/storage-files-introduction
/// </summary>
AzureStorage,

/// <summary>
/// Represents Azure Workload
/// </summary>
AzureWorkload
}

/// <summary>
Expand Down Expand Up @@ -103,6 +113,11 @@ public enum WorkloadType
/// Represents Azure File https://docs.microsoft.com/en-in/azure/storage/files/storage-files-introduction
/// </summary>
AzureFiles,

/// <summary>
/// Represents MSSQL in Azure VM.
/// </summary>
MSSQL,
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ public static BackupManagementType GetPsBackupManagementType(string backupManage
return BackupManagementType.AzureSQL;
case ServiceClientModel.BackupManagementType.AzureStorage:
return BackupManagementType.AzureStorage;
case ServiceClientModel.BackupManagementType.AzureWorkload:
return BackupManagementType.AzureWorkload;
default:
throw new Exception("Unsupported BackupManagmentType: " + backupManagementType);
}
Expand Down Expand Up @@ -248,6 +250,11 @@ public static ContainerType GetPsContainerType(string containerType)
{
return ContainerType.AzureStorage;
}
else if (containerType ==
ServiceClientModel.BackupManagementType.AzureWorkload)
{
return ContainerType.AzureWorkload;
}
else
{
throw new Exception("Unsupported ContainerType: " + containerType);
Expand All @@ -265,14 +272,18 @@ public static WorkloadType GetPsWorkloadType(string workloadType)
{
return WorkloadType.AzureVM;
}
if (workloadType == ServiceClientModel.WorkloadType.AzureSqlDb.ToString())
else if (workloadType == ServiceClientModel.WorkloadType.AzureSqlDb.ToString())
{
return WorkloadType.AzureSQLDatabase;
}
if (workloadType == ServiceClientModel.WorkloadType.AzureFileShare)
else if (workloadType == ServiceClientModel.WorkloadType.AzureFileShare)
{
return WorkloadType.AzureFiles;
}
else if (workloadType == ServiceClientModel.WorkloadType.SQLDataBase)
{
return WorkloadType.MSSQL;
}
else
{
throw new Exception("Unsupported WorkloadType: " + workloadType);
Expand All @@ -290,14 +301,18 @@ public static string GetServiceClientWorkloadType(string workloadType)
{
return ServiceClientModel.WorkloadType.VM;
}
if (workloadType == WorkloadType.AzureSQLDatabase.ToString())
else if (workloadType == WorkloadType.AzureSQLDatabase.ToString())
{
return ServiceClientModel.WorkloadType.AzureSqlDb;
}
if (workloadType == WorkloadType.AzureFiles.ToString())
else if (workloadType == WorkloadType.AzureFiles.ToString())
{
return ServiceClientModel.WorkloadType.AzureFileShare;
}
else if (workloadType == WorkloadType.MSSQL.ToString())
{
return ServiceClientModel.WorkloadType.SQLDataBase;
}
else
{
throw new Exception("Unsupported WorkloadType: " + workloadType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Providers\AzureFilesPsBackupProvider.cs" />
<Compile Include="Providers\AzureSqlPsBackupProvider.cs" />
<Compile Include="Providers\AzureWorkloadPsBackupProvider.cs" />
<Compile Include="Providers\DpmPsBackupProvider.cs" />
<Compile Include="Providers\MabPsBackupProvider.cs" />
<Compile Include="PsBackupProviderManager.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models;
using Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.ServiceClientAdapterNS;
using Microsoft.Azure.Management.RecoveryServices.Backup.Models;
using System;
using System.Collections.Generic;
using CmdletModel = Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models;
using RestAzureNS = Microsoft.Rest.Azure;

namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.ProviderModel
{
/// <summary>
/// This class implements methods for azure files backup provider
/// </summary>
public class AzureWorkloadPsBackupProvider : IPsBackupProvider
{
public ResourceBackupStatus CheckBackupStatus()
{
throw new NotImplementedException();
}

public ProtectionPolicyResource CreatePolicy()
{
throw new NotImplementedException();
}

public RestAzureNS.AzureOperationResponse DisableProtection()
{
throw new NotImplementedException();
}

public RestAzureNS.AzureOperationResponse EnableProtection()
{
throw new NotImplementedException();
}

public RetentionPolicyBase GetDefaultRetentionPolicyObject()
{
throw new NotImplementedException();
}

public SchedulePolicyBase GetDefaultSchedulePolicyObject()
{
throw new NotImplementedException();
}

public ProtectedItemResource GetProtectedItem()
{
throw new NotImplementedException();
}

public RecoveryPointBase GetRecoveryPointDetails()
{
throw new NotImplementedException();
}

public void Initialize(Dictionary<Enum, object> providerData, ServiceClientAdapter serviceClientAdapter)
{
throw new NotImplementedException();
}

public List<CmdletModel.BackupEngineBase> ListBackupManagementServers()
{
throw new NotImplementedException();
}

public List<ItemBase> ListProtectedItems()
{
throw new NotImplementedException();
}

public List<ContainerBase> ListProtectionContainers()
{
throw new NotImplementedException();
}

public List<RecoveryPointBase> ListRecoveryPoints()
{
throw new NotImplementedException();
}

public RestAzureNS.AzureOperationResponse<ProtectionPolicyResource> ModifyPolicy()
{
throw new NotImplementedException();
}

public RPMountScriptDetails ProvisionItemLevelRecoveryAccess()
{
throw new NotImplementedException();
}

public void RevokeItemLevelRecoveryAccess()
{
throw new NotImplementedException();
}

public RestAzureNS.AzureOperationResponse TriggerBackup()
{
throw new NotImplementedException();
}

public RestAzureNS.AzureOperationResponse TriggerRestore()
{
throw new NotImplementedException();
}
}
}