public ContainerBase(ServiceClientModel.ProtectionContainerResource protectionContainer) : base(ConversionUtils.GetPsContainerType( protectionContainer.Properties.ContainerType.ToString()), protectionContainer.Properties.BackupManagementType.ToString()) { Name = IdUtils.GetNameFromUri(protectionContainer.Name); }
/// <summary> /// Helper function to convert ps backup container model from service response. /// </summary> public static ContainerBase GetContainerModel(ServiceClientModel.ProtectionContainerResource protectionContainer) { ContainerBase containerModel = null; if (protectionContainer != null && protectionContainer.Properties != null) { if (protectionContainer.Properties.GetType().IsSubclassOf(typeof(ServiceClientModel.IaaSVMContainer))) { containerModel = new AzureVmContainer(protectionContainer); } else if (protectionContainer.Properties.GetType() == typeof(ServiceClientModel.MabContainer)) { containerModel = new MabContainer(protectionContainer); } else if (protectionContainer.Properties.GetType() == typeof(ServiceClientModel.AzureSqlContainer)) { containerModel = new AzureSqlContainer(protectionContainer); } else if (protectionContainer.Properties.GetType() == typeof(ServiceClientModel.AzureStorageContainer)) { containerModel = new AzureFileShareContainer(protectionContainer); } else if (protectionContainer.Properties.GetType() == typeof(ServiceClientModel.AzureVMAppContainerProtectionContainer)) { containerModel = new AzureVmWorkloadContainer(protectionContainer); } } return(containerModel); }
public MabContainer(ProtectionContainerResource protectionContainer) : base(protectionContainer) { MabProtectionContainer mabProtectionContainer = (MabProtectionContainer)protectionContainer.Properties; FriendlyName = mabProtectionContainer.FriendlyName; Status = EnumUtils.GetEnum<ContainerRegistrationStatus>(mabProtectionContainer.RegistrationStatus); }
public MabContainer(ServiceClientModel.ProtectionContainerResource protectionContainer) : base(protectionContainer) { ServiceClientModel.MabContainer mabProtectionContainer = (ServiceClientModel.MabContainer)protectionContainer.Properties; FriendlyName = mabProtectionContainer.FriendlyName; Status = EnumUtils.GetEnum <ContainerRegistrationStatus>(mabProtectionContainer.RegistrationStatus); }
// <summary> /// Constructor. Takes the service client object representing the container /// and converts it in to the PS container model /// </summary> /// <param name="protectionContainer">Service client object representing the container</param> public AzureSqlContainer(ProtectionContainerResource protectionContainer) : base(protectionContainer) { AzureSqlProtectionContainer sqlProtectionContainer = (AzureSqlProtectionContainer)protectionContainer.Properties; Status = EnumUtils.GetEnum<ContainerRegistrationStatus>( sqlProtectionContainer.RegistrationStatus); }
/// <summary> /// Constructor. Takes the service client object representing the container /// and converts it in to the PS container model /// </summary> /// <param name="protectionContainer">Service client object representing the container</param> public AzureVmContainer(ProtectionContainerResource protectionContainer) : base(protectionContainer) { AzureIaaSVMProtectionContainer iaasVmProtectionContainer = (AzureIaaSVMProtectionContainer)protectionContainer.Properties; ResourceGroupName = IdUtils.GetResourceGroupName(protectionContainer.Id); FriendlyName = iaasVmProtectionContainer.FriendlyName; Status = EnumUtils.GetEnum<ContainerRegistrationStatus>(iaasVmProtectionContainer.RegistrationStatus); }
/// <summary> /// Constructor. Takes the service client object representing the container /// and converts it in to the PS container model /// </summary> /// <param name="protectionContainer">Service client object representing the container</param> public AzureSqlContainer( ServiceClientModel.ProtectionContainerResource protectionContainer) : base(protectionContainer) { ServiceClientModel.AzureSqlContainer sqlProtectionContainer = (ServiceClientModel.AzureSqlContainer)protectionContainer.Properties; Status = EnumUtils.GetEnum <ContainerRegistrationStatus>( sqlProtectionContainer.RegistrationStatus); }
public ContainerBase(ServiceClientModel.ProtectionContainerResource protectionContainer) : base(ConversionUtils.GetPsContainerType( protectionContainer.Properties.BackupManagementType), protectionContainer.Properties.BackupManagementType) { if (string.Compare(protectionContainer.Properties.BackupManagementType, ServiceClientModel.BackupManagementType.AzureWorkload) == 0) { Name = protectionContainer.Name; } else { Name = IdUtils.GetNameFromUri(protectionContainer.Name); } }
/// <summary> /// Helper function to convert ps backup container model from service response. /// </summary> public static ContainerBase GetContainerModel(ServiceClientModel.ProtectionContainerResource protectionContainer) { ContainerBase containerModel = null; if (protectionContainer != null && protectionContainer.Properties != null) { if (protectionContainer.Properties.GetType().IsSubclassOf(typeof(ServiceClientModel.AzureIaaSVMProtectionContainer))) { containerModel = new AzureVmContainer(protectionContainer); } if (protectionContainer.Properties.GetType() == typeof(ServiceClientModel.MabProtectionContainer)) { containerModel = new MabContainer(protectionContainer); } } return(containerModel); }