public JsonResult UpsertCodeSourceConfig(ServiceCodeSourceConfig config)
        {
            ThirdPartyManager manager = new ThirdPartyManager();
            var result = manager.UpsertCodeSourceConfig(config);

            return(Json(new { status = result.Item1, msg = result.Item2 }, JsonRequestBehavior.AllowGet));
        }
        public JsonResult GetCodeSourceConfig(int pageIndex = 1, int pageSize = 10)
        {
            ThirdPartyManager manager = new ThirdPartyManager();
            var result = manager.GetServiceCodeSourceConfig(pageIndex, pageSize);

            return(Json(new { data = result, total = result.FirstOrDefault().Total }, JsonRequestBehavior.AllowGet));
        }
예제 #3
0
        // Token: 0x060001A8 RID: 424 RVA: 0x0000A59C File Offset: 0x0000879C
        internal void MoveDatabase(Guid mdbGuid, MountFlags mountFlags, UnmountFlags dismountFlags, DatabaseMountDialOverride mountDialOverride, AmServerName fromServer, AmServerName targetServer, bool tryOtherHealthyServers, AmBcsSkipFlags skipValidationChecks, AmDbActionCode actionCode, string moveComment, ref AmDatabaseMoveResult databaseMoveResult)
        {
            AmTrace.Debug("Task: MoveDatabase({0},{1},{2},{3},{4},{5},{6},{7},'{8}') called", new object[]
            {
                mdbGuid,
                mountFlags,
                dismountFlags,
                mountDialOverride,
                fromServer,
                targetServer,
                tryOtherHealthyServers,
                actionCode,
                moveComment
            });
            ActiveManagerCore.ValidatePamOrStandalone("MoveDatabase");
            ThirdPartyManager.PreventOperationWhenTPREnabled("MoveDatabase");
            IADDatabase iaddatabase = this.AdLookup.DatabaseLookup.FindAdObjectByGuidEx(mdbGuid, AdObjectLookupFlags.ReadThrough);

            if (iaddatabase == null)
            {
                throw new AmDatabaseNotFoundException(mdbGuid);
            }
            AmDbMoveOperation    amDbMoveOperation    = new AmDbMoveOperation(iaddatabase, actionCode);
            AmDbMoveArguments    arguments            = amDbMoveOperation.Arguments;
            AmDbCompletionReason amDbCompletionReason = AmDbCompletionReason.None;

            arguments.MountFlags             = mountFlags;
            arguments.DismountFlags          = dismountFlags;
            arguments.MountDialOverride      = mountDialOverride;
            arguments.SourceServer           = fromServer;
            arguments.TargetServer           = targetServer;
            arguments.TryOtherHealthyServers = tryOtherHealthyServers;
            arguments.SkipValidationChecks   = skipValidationChecks;
            arguments.MoveComment            = moveComment;
            amDbMoveOperation.Arguments      = arguments;
            amDbMoveOperation.Enqueue();
            try
            {
                amDbCompletionReason = amDbMoveOperation.Wait();
            }
            finally
            {
                if (amDbMoveOperation.DetailedStatus != null)
                {
                    databaseMoveResult = amDbMoveOperation.ConvertDetailedStatusToRpcMoveResult(amDbMoveOperation.DetailedStatus);
                }
            }
            AmTrace.Debug("MoveDatabase({0}) completed (reason={1})", new object[]
            {
                mdbGuid,
                amDbCompletionReason
            });
        }
예제 #4
0
 // Token: 0x060001B0 RID: 432 RVA: 0x0000AB10 File Offset: 0x00008D10
 internal void AttemptCopyLastLogsDirect(Guid mdbGuid, AmAcllArgs acllArgs, ref AmAcllReturnStatus acllStatus)
 {
     acllStatus = new AmAcllReturnStatus();
     ThirdPartyManager.PreventOperationWhenTPREnabled("AttemptCopyLastLogsDirect");
     if (!AmHelper.IsDatabaseRcrEnabled(mdbGuid))
     {
         throw new AmDbMoveOperationNotSupportedException(mdbGuid.ToString());
     }
     AmTrace.Debug("AttemptCopyLastLogsDirect: Calling AmAcllCallback ({0})", new object[]
     {
         mdbGuid
     });
     acllStatus = this.m_replicaInstanceManager.AmAttemptCopyLastLogsCallback(mdbGuid, acllArgs);
     if (acllArgs.ActionCode.IsAutomaticShutdownSwitchover)
     {
         if (!acllStatus.NoLoss)
         {
             ReplayCrimsonEvents.AcllFailedOnSwitchover.Log <Guid>(mdbGuid);
             throw new AcllFailedException(acllStatus.LastError);
         }
         ReplayCrimsonEvents.AcllLosslessOnSwitchover.Log <Guid>(mdbGuid);
         return;
     }
     else
     {
         if (!acllStatus.NoLoss && acllStatus.MountAllowed)
         {
             ReplayCrimsonEvents.LossyMountEnabled.Log <Guid>(mdbGuid);
             AmTrace.Warning("AttemptCopyLastLogsDirect: ACLL detected a lossy mount will be allowed for DB {0}.", new object[]
             {
                 mdbGuid
             });
             return;
         }
         if (acllStatus.MountAllowed)
         {
             AmTrace.Debug("AttemptCopyLastLogsDirect: ACLL completed with no loss for DB {0}.", new object[]
             {
                 mdbGuid
             });
             ReplayCrimsonEvents.AcllLosslessOnMoveOrFailover.Log <Guid>(mdbGuid);
             return;
         }
         if (string.IsNullOrEmpty(acllStatus.LastError))
         {
             ReplayCrimsonEvents.MountRejected.Log <Guid>(mdbGuid);
             throw new AmDbMountNotAllowedDueToLossException();
         }
         ReplayCrimsonEvents.MountRejectedAcllError.Log <Guid, string>(mdbGuid, acllStatus.LastError);
         throw new AmDbMountNotAllowedDueToAcllErrorException(acllStatus.LastError, acllStatus.NumberOfLogsLost);
     }
 }
예제 #5
0
        // Token: 0x060001AA RID: 426 RVA: 0x0000A74C File Offset: 0x0000894C
        internal List <AmDatabaseMoveResult> ServerMoveAllDatabases(AmServerName sourceServer, AmServerName targetServer, MountFlags mountFlags, UnmountFlags dismountFlags, DatabaseMountDialOverride mountDialOverride, bool tryOtherHealthyServers, AmBcsSkipFlags skipValidationChecks, AmDbActionCode actionCode, string moveComment, string componentName)
        {
            AmTrace.Debug("ServerMoveAllDatabases() called: sourceServer='{0}', targetServer='{1}', mountFlags='{2}', dismountFlags='{3}', mountDialOverride='{4}', tryOtherHealthyServers='{5}', skipValidationChecks='{6}', actionCode='{7}', MoveComment='{8}' Component='{9}'", new object[]
            {
                sourceServer,
                targetServer,
                mountFlags,
                dismountFlags,
                mountDialOverride,
                tryOtherHealthyServers,
                skipValidationChecks,
                actionCode,
                moveComment,
                componentName
            });
            ActiveManagerCore.ValidatePamOrStandalone("ServerMoveAllDatabases");
            ThirdPartyManager.PreventOperationWhenTPREnabled("ServerMoveAllDatabases");
            AmDbMoveArguments amDbMoveArguments = new AmDbMoveArguments(actionCode);

            amDbMoveArguments.SourceServer           = sourceServer;
            amDbMoveArguments.TargetServer           = targetServer;
            amDbMoveArguments.MountFlags             = mountFlags;
            amDbMoveArguments.DismountFlags          = dismountFlags;
            amDbMoveArguments.MountDialOverride      = mountDialOverride;
            amDbMoveArguments.TryOtherHealthyServers = tryOtherHealthyServers;
            amDbMoveArguments.SkipValidationChecks   = skipValidationChecks;
            amDbMoveArguments.MoveComment            = moveComment;
            amDbMoveArguments.ComponentName          = componentName;
            if (string.IsNullOrEmpty(sourceServer.Fqdn))
            {
                return(MoveBackToServer.Move(amDbMoveArguments));
            }
            AmEvtMoveAllDatabasesBase amEvtMoveAllDatabasesBase;

            if (actionCode.IsAutomaticManagedAvailabilityFailover)
            {
                amEvtMoveAllDatabasesBase = new AmEvtMoveAllDatabasesOnComponentRequest(sourceServer);
            }
            else
            {
                amEvtMoveAllDatabasesBase = new AmEvtMoveAllDatabasesOnAdminRequest(sourceServer);
            }
            amEvtMoveAllDatabasesBase.MoveArgs = amDbMoveArguments;
            amEvtMoveAllDatabasesBase.Notify();
            amEvtMoveAllDatabasesBase.WaitForSwitchoverComplete();
            AmTrace.Debug("ServerMoveAllDatabases({0}) completed", new object[]
            {
                sourceServer
            });
            return(amEvtMoveAllDatabasesBase.GetMoveResultsForOperationsRun());
        }