예제 #1
0
 public void UpdateAgentNodeId(int agentId, int nodeId)
 {
     using (SwisConnectionProxyFactory connectionProxyFactory = new SwisConnectionProxyFactory())
     {
         using (IInformationServiceProxy2 proxy = connectionProxyFactory.Create())
             this.UpdateAgentNodeId(agentId, nodeId, proxy);
     }
 }
예제 #2
0
 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
             });
     }
 }
예제 #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
             });
         }
     }
 }
예제 #4
0
 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
             });
     }
 }
예제 #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
             });
         }
     }
 }
예제 #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);
        }
예제 #7
0
 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);
         }
     }
 }
예제 #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);
             }
         }
     }
 }
예제 #9
0
 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);
             }
         }
     }
 }