Exemple #1
0
 public override void ExecuteCmdlet()
 {
     try
     {
         var confirmMigrationRequest = new MigrationConfirmStatusRequest();
         confirmMigrationRequest.Operation =
             (MigrationOperation)Enum.Parse(typeof(MigrationOperation), MigrationOperation, true);
         confirmMigrationRequest.DataContainerNameList = (null != LegacyContainerNames)
             ? new List <string>(LegacyContainerNames.ToList().Distinct(StringComparer.InvariantCultureIgnoreCase))
             : new List <string>();
         var status = StorSimpleClient.ConfirmLegacyVolumeContainerStatus(LegacyConfigId, confirmMigrationRequest);
         MigrationCommonModelFormatter opFormatter = new MigrationCommonModelFormatter();
         WriteObject(opFormatter.GetResultMessage(Resources.ConfirmMigrationSuccessMessage, status));
     }
     catch (Exception except)
     {
         this.HandleException(except);
     }
 }
Exemple #2
0
        public override void ExecuteCmdlet()
        {
            try
            {
                var confirmMigrationRequest = new MigrationConfirmStatusRequest();
                confirmMigrationRequest.Operation =
                    (MigrationOperation)Enum.Parse(typeof(MigrationOperation), MigrationOperation, true);
                switch (ParameterSetName)
                {
                case StorSimpleCmdletParameterSet.MigrateAllContainer:
                {
                    confirmMigrationRequest.DataContainerNameList = new List <string>();
                    break;
                }

                case StorSimpleCmdletParameterSet.MigrateSpecificContainer:
                {
                    confirmMigrationRequest.DataContainerNameList =
                        new List <string>(LegacyContainerNames.ToList().Distinct(
                                              StringComparer.InvariantCultureIgnoreCase));
                    break;
                }

                default:
                {
                    // unexpected code path hit.
                    throw new ParameterBindingException(
                              string.Format(Resources.MigrationParameterSetNotFound, ParameterSetName));
                }
                }

                var status = StorSimpleClient.ConfirmLegacyVolumeContainerStatus(LegacyConfigId, confirmMigrationRequest);
                MigrationCommonModelFormatter opFormatter = new MigrationCommonModelFormatter();
                WriteObject(opFormatter.GetResultMessage(Resources.ConfirmMigrationSuccessMessage, status));
            }
            catch (Exception except)
            {
                this.HandleException(except);
            }
        }