Ejemplo n.º 1
0
        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;
                }
            });
        }
Ejemplo n.º 2
0
        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);
                }
            });
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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);
        }