private int DeployAgent(AgentDeploymentSettings settings)
        {
            AgentDeployer.log.Debug((object)"DeployAgent started");
            AgentManager agentManager = new AgentManager(this.agentInfoDal);
            int          agentId      = agentManager.StartDeployingAgent(settings);

            agentManager.UpdateAgentNodeId(agentId, settings.get_NodeId());
            AgentDeployer.log.DebugFormat("DeployAgent finished, AgentId:{0}", (object)agentId);
            return(agentId);
        }
Beispiel #2
0
        // Token: 0x06000904 RID: 2308 RVA: 0x00041240 File Offset: 0x0003F440
        private int DeployAgent(AgentDeploymentSettings settings)
        {
            AgentDeployer.log.Debug("DeployAgent started");
            AgentManager agentManager = new AgentManager(this.agentInfoDal);
            int          num          = agentManager.StartDeployingAgent(settings);

            agentManager.UpdateAgentNodeId(num, settings.NodeId);
            AgentDeployer.log.DebugFormat("DeployAgent finished, AgentId:{0}", num);
            return(num);
        }
        public int StartDeployingAgent(AgentDeploymentSettings settings)
        {
            AgentDeployer.log.Debug((object)"StartDeployingAgent entered");
            AgentDeploymentWatcher instance = AgentDeploymentWatcher.GetInstance(this.agentInfoDal);

            instance.Start();
            int agentId = this.DeployAgent(settings);

            instance.AddOrUpdateDeploymentInfo(AgentDeploymentInfo.Calculate(new AgentManager(this.agentInfoDal).GetAgentInfo(agentId), (IEnumerable <string>)settings.get_RequiredPlugins(), (string)null));
            this.DeployMissingPlugins(agentId, (IEnumerable <string>)settings.get_RequiredPlugins());
            return(agentId);
        }
Beispiel #4
0
        // Token: 0x06000901 RID: 2305 RVA: 0x00040F7C File Offset: 0x0003F17C
        public int StartDeployingAgent(AgentDeploymentSettings settings)
        {
            AgentDeployer.log.Debug("StartDeployingAgent entered");
            AgentDeploymentWatcher instance = AgentDeploymentWatcher.GetInstance(this.agentInfoDal);

            instance.Start();
            int       num       = this.DeployAgent(settings);
            AgentInfo agentInfo = new AgentManager(this.agentInfoDal).GetAgentInfo(num);

            instance.AddOrUpdateDeploymentInfo(AgentDeploymentInfo.Calculate(agentInfo, settings.RequiredPlugins, null));
            this.DeployMissingPlugins(num, settings.RequiredPlugins);
            return(num);
        }
Beispiel #5
0
        // Token: 0x0600091D RID: 2333 RVA: 0x00041B94 File Offset: 0x0003FD94
        public int StartDeployingAgent(AgentDeploymentSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }
            if (string.IsNullOrWhiteSpace(settings.IpAddress) && string.IsNullOrWhiteSpace(settings.Hostname))
            {
                throw new ArgumentException("ipAddress or hostname must be specified");
            }
            int result;

            using (SwisConnectionProxyFactory swisConnectionProxyFactory = new SwisConnectionProxyFactory())
            {
                using (IInformationServiceProxy2 informationServiceProxy = swisConnectionProxyFactory.Create())
                {
                    string text  = (!string.IsNullOrEmpty(settings.Hostname)) ? settings.Hostname : settings.IpAddress;
                    string text2 = text;
                    int    num   = 1;
                    while (!this._agentInfoDal.IsUniqueAgentName(text2))
                    {
                        text2 = string.Format("{0}-{1}", text, ++num);
                    }
                    int num2 = informationServiceProxy.Invoke <int>("Orion.AgentManagement.Agent", "Deploy", new object[]
                    {
                        settings.EngineId,
                        text2,
                        text,
                        settings.IpAddress,
                        settings.Credentials.Username,
                        settings.Credentials.Password,
                        settings.Credentials.AdditionalUsername ?? "",
                        settings.Credentials.AdditionalPassword ?? "",
                        settings.Credentials.PasswordIsPrivateKey,
                        settings.Credentials.PrivateKeyPassword ?? "",
                        0,
                        settings.InstallPackageId ?? ""
                    });
                    this.UpdateAgentNodeId(num2, 0);
                    result = num2;
                }
            }
            return(result);
        }
 public int StartDeployingAgent(AgentDeploymentSettings settings)
 {
     if (settings == null)
     {
         throw new ArgumentNullException(nameof(settings));
     }
     if (string.IsNullOrWhiteSpace(settings.get_IpAddress()) && string.IsNullOrWhiteSpace(settings.get_Hostname()))
     {
         throw new ArgumentException("ipAddress or hostname must be specified");
     }
     using (SwisConnectionProxyFactory connectionProxyFactory = new SwisConnectionProxyFactory())
     {
         using (IInformationServiceProxy2 iinformationServiceProxy2 = connectionProxyFactory.Create())
         {
             string str       = !string.IsNullOrEmpty(settings.get_Hostname()) ? settings.get_Hostname() : settings.get_IpAddress();
             string agentName = str;
             int    num       = 1;
             while (!this._agentInfoDal.IsUniqueAgentName(agentName))
             {
                 agentName = string.Format("{0}-{1}", (object)str, (object)++num);
             }
             int agentId = (int)iinformationServiceProxy2.Invoke <int>("Orion.AgentManagement.Agent", "Deploy", new object[12]
             {
                 (object)settings.get_EngineId(),
                 (object)agentName,
                 (object)str,
                 (object)settings.get_IpAddress(),
                 (object)settings.get_Credentials().get_Username(),
                 (object)settings.get_Credentials().get_Password(),
                 (object)(settings.get_Credentials().get_AdditionalUsername() ?? ""),
                 (object)(settings.get_Credentials().get_AdditionalPassword() ?? ""),
                 (object)settings.get_Credentials().get_PasswordIsPrivateKey(),
                 (object)(settings.get_Credentials().get_PrivateKeyPassword() ?? ""),
                 (object)0,
                 (object)(settings.get_InstallPackageId() ?? "")
             });
             this.UpdateAgentNodeId(agentId, 0);
             return(agentId);
         }
     }
 }