public override void ExecuteCmdlet() { ExecutionBlock(() => { base.ExecuteCmdlet(); AzureBackupContainerType containerType = (AzureBackupContainerType)Enum.Parse(typeof(AzureBackupContainerType), Container.ContainerType, true); switch (containerType) { case AzureBackupContainerType.Windows: case AzureBackupContainerType.SCDPM: case AzureBackupContainerType.AzureBackupServer: case AzureBackupContainerType.Other: DeleteServer(); break; case AzureBackupContainerType.AzureVM: UnregisterContainer(); break; default: break; } }); }
public override void ExecuteCmdlet() { ExecutionBlock(() => { base.ExecuteCmdlet(); AzureBackupContainerType containerType = (AzureBackupContainerType)Enum.Parse(typeof(AzureBackupContainerType), Container.ContainerType); switch (containerType) { case AzureBackupContainerType.Windows: case AzureBackupContainerType.SCDPM: AzureBackupClient.EnableMachineContainerReregistration(Container.Id); break; default: throw new ArgumentException("Reregistration can be enable only for machine containers."); } }); }
public override void ExecuteCmdlet() { ExecutionBlock(() => { base.ExecuteCmdlet(); AzureBackupContainerType containerType = (AzureBackupContainerType)Enum.Parse(typeof(AzureBackupContainerType), Container.ContainerType); switch (containerType) { case AzureBackupContainerType.Windows: case AzureBackupContainerType.SCDPM: AzureBackupClient.EnableMachineContainerReregistration(Container.ResourceGroupName, Container.ResourceName, Container.Id); break; default: throw new ArgumentException(Resources.CannotEnableRegistration); } }); }
internal static AzureBackupContainerType GetContainerType(string customerTypeString) { AzureBackupContainerType containerType = 0; CustomerType customerType = CustomerType.Invalid; if (Enum.TryParse <CustomerType>(customerTypeString, out customerType)) { switch (customerType) { case CustomerType.DPM: containerType = AzureBackupContainerType.SCDPM; break; case CustomerType.OBS: containerType = AzureBackupContainerType.Windows; break; case CustomerType.SBS: containerType = AzureBackupContainerType.Windows; break; case CustomerType.DPMVenus: containerType = AzureBackupContainerType.AzureBackupServer; break; case CustomerType.Invalid: break; default: containerType = AzureBackupContainerType.Other; break; } } else if (!string.IsNullOrEmpty(customerTypeString)) { containerType = AzureBackupContainerType.Other; } return(containerType); }
internal static AzureBackupContainerType GetContainerType(string customerType) { CustomerType type = (CustomerType)Enum.Parse(typeof(CustomerType), customerType); AzureBackupContainerType containerType = 0; switch (type) { case CustomerType.DPM: containerType = AzureBackupContainerType.SCDPM; break; case CustomerType.InMage: break; case CustomerType.Invalid: break; case CustomerType.ManagedContainer: break; case CustomerType.OBS: containerType = AzureBackupContainerType.Windows; break; case CustomerType.SBS: containerType = AzureBackupContainerType.Windows; break; case CustomerType.SqlPaaS: break; default: break; } return(containerType); }
internal static AzureBackupContainerType GetTypeForManagedContainer(string managedContainerTypeString) { ManagedContainerType managedContainerType = (ManagedContainerType)Enum.Parse(typeof(ManagedContainerType), managedContainerTypeString, true); AzureBackupContainerType containerType = 0; switch (managedContainerType) { case ManagedContainerType.Invalid: break; case ManagedContainerType.IaasVM: containerType = AzureBackupContainerType.AzureVM; break; case ManagedContainerType.IaasVMService: break; default: break; } return(containerType); }