public void UpdateAgentNodeId(int agentId, int nodeId)
 {
     using (SwisConnectionProxyFactory connectionProxyFactory = new SwisConnectionProxyFactory())
     {
         using (IInformationServiceProxy2 proxy = connectionProxyFactory.Create())
             this.UpdateAgentNodeId(agentId, nodeId, proxy);
     }
 }
 public void ApproveUpdate(int agentId)
 {
     using (SwisConnectionProxyFactory connectionProxyFactory = new SwisConnectionProxyFactory())
     {
         using (IInformationServiceProxy2 iinformationServiceProxy2 = connectionProxyFactory.Create())
             iinformationServiceProxy2.Invoke <object>("Orion.AgentManagement.Agent", nameof(ApproveUpdate), new object[1]
             {
                 (object)agentId
             });
     }
 }
Esempio n. 3
0
 // Token: 0x06000920 RID: 2336 RVA: 0x00041E60 File Offset: 0x00040060
 public void ApproveUpdate(int agentId)
 {
     using (SwisConnectionProxyFactory swisConnectionProxyFactory = new SwisConnectionProxyFactory())
     {
         using (IInformationServiceProxy2 informationServiceProxy = swisConnectionProxyFactory.Create())
         {
             informationServiceProxy.Invoke <object>("Orion.AgentManagement.Agent", "ApproveUpdate", new object[]
             {
                 agentId
             });
         }
     }
 }
 public void StartDeployingPlugin(int agentId, string pluginId)
 {
     if (string.IsNullOrEmpty(pluginId))
     {
         throw new ArgumentNullException(nameof(pluginId), "Plugin Id must be specified.");
     }
     using (SwisConnectionProxyFactory connectionProxyFactory = new SwisConnectionProxyFactory())
     {
         using (IInformationServiceProxy2 iinformationServiceProxy2 = connectionProxyFactory.Create())
             iinformationServiceProxy2.Invoke <object>("Orion.AgentManagement.Agent", "DeployPlugin", new object[2]
             {
                 (object)agentId,
                 (object)pluginId
             });
     }
 }
Esempio n. 5
0
 // Token: 0x0600091F RID: 2335 RVA: 0x00041DD8 File Offset: 0x0003FFD8
 public void StartRedeployingPlugin(int agentId, string pluginId)
 {
     if (string.IsNullOrEmpty(pluginId))
     {
         throw new ArgumentNullException("pluginId", "Plugin Id must be specified.");
     }
     using (SwisConnectionProxyFactory swisConnectionProxyFactory = new SwisConnectionProxyFactory())
     {
         using (IInformationServiceProxy2 informationServiceProxy = swisConnectionProxyFactory.Create())
         {
             informationServiceProxy.Invoke <object>("Orion.AgentManagement.Agent", "RedeployPlugin", new object[]
             {
                 agentId,
                 pluginId
             });
         }
     }
 }
Esempio n. 6
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);
         }
     }
 }
Esempio n. 8
0
 // Token: 0x06000923 RID: 2339 RVA: 0x00041F7C File Offset: 0x0004017C
 public void ResetAgentNodeId(int nodeId)
 {
     using (SwisConnectionProxyFactory swisConnectionProxyFactory = new SwisConnectionProxyFactory())
     {
         using (IInformationServiceProxy2 informationServiceProxy = swisConnectionProxyFactory.Create())
         {
             AgentInfo agentInfoByNode = this._agentInfoDal.GetAgentInfoByNode(nodeId);
             if (agentInfoByNode != null)
             {
                 informationServiceProxy.Update(agentInfoByNode.Uri, new Dictionary <string, object>
                 {
                     {
                         "NodeId",
                         nodeId
                     }
                 });
             }
             else
             {
                 AgentManager.log.WarnFormat("Agent for NodeId={0} not found", nodeId);
             }
         }
     }
 }
 public void ResetAgentNodeId(int nodeId)
 {
     using (SwisConnectionProxyFactory connectionProxyFactory = new SwisConnectionProxyFactory())
     {
         using (IInformationServiceProxy2 iinformationServiceProxy2 = connectionProxyFactory.Create())
         {
             AgentInfo agentInfoByNode = this._agentInfoDal.GetAgentInfoByNode(nodeId);
             if (agentInfoByNode != null)
             {
                 ((IInformationServiceProxy)iinformationServiceProxy2).Update(agentInfoByNode.get_Uri(), (IDictionary <string, object>) new Dictionary <string, object>()
                 {
                     {
                         "NodeId",
                         (object)nodeId
                     }
                 });
             }
             else
             {
                 AgentManager.log.WarnFormat("Agent for NodeId={0} not found", (object)nodeId);
             }
         }
     }
 }