Beispiel #1
0
        // Token: 0x06000589 RID: 1417 RVA: 0x00021A04 File Offset: 0x0001FC04
        public void Unmanage(MaintenancePlanAssignment assignment)
        {
            MaintenancePlan maintenancePlan = this.maintenancePlanDAL.Get(assignment.MaintenancePlanID);

            if (maintenancePlan == null)
            {
                throw new Exception(string.Format("No maintenance plan found for PlanID={0}.", assignment.MaintenancePlanID));
            }
            string netObjectPrefix = this.GetNetObjectPrefix(assignment.EntityType);

            if (netObjectPrefix == null)
            {
                throw new Exception(string.Format("Cannot find net object prefix for EntityType='{0}'.", assignment.EntityType));
            }
            object obj = this.CreateNetObjectId(netObjectPrefix, assignment.EntityID);

            if (obj == null)
            {
                throw new Exception(string.Format("Cannot create net object id from prefix '{0}' and id '{1}'.", netObjectPrefix, assignment.EntityID));
            }
            using (IInformationServiceProxy2 informationServiceProxy = this.swisProxy.Create())
            {
                informationServiceProxy.Invoke <object>(assignment.EntityType, "Unmanage", new object[]
                {
                    obj,
                    maintenancePlan.UnmanageDate,
                    maintenancePlan.RemanageDate,
                    false
                });
            }
        }
        public void Unmanage(MaintenancePlanAssignment assignment)
        {
            MaintenancePlan maintenancePlan = this.maintenancePlanDAL.Get(assignment.get_MaintenancePlanID());

            if (maintenancePlan == null)
            {
                throw new Exception(string.Format("No maintenance plan found for PlanID={0}.", (object)assignment.get_MaintenancePlanID()));
            }
            string netObjectPrefix = this.GetNetObjectPrefix(assignment.get_EntityType());

            if (netObjectPrefix == null)
            {
                throw new Exception(string.Format("Cannot find net object prefix for EntityType='{0}'.", (object)assignment.get_EntityType()));
            }
            object netObjectId = this.CreateNetObjectId(netObjectPrefix, assignment.get_EntityID());

            if (netObjectId == null)
            {
                throw new Exception(string.Format("Cannot create net object id from prefix '{0}' and id '{1}'.", (object)netObjectPrefix, (object)assignment.get_EntityID()));
            }
            using (IInformationServiceProxy2 iinformationServiceProxy2 = this.swisProxy.Create())
                iinformationServiceProxy2.Invoke <object>(assignment.get_EntityType(), nameof(Unmanage), new object[4]
                {
                    netObjectId,
                    (object)maintenancePlan.get_UnmanageDate(),
                    (object)maintenancePlan.get_RemanageDate(),
                    (object)false
                });
        }
 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
             });
     }
 }
Beispiel #4
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
             });
     }
 }
Beispiel #6
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
             });
         }
     }
 }
Beispiel #7
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 void Remanage(MaintenancePlanAssignment assignment)
        {
            string netObjectPrefix = this.GetNetObjectPrefix(assignment.get_EntityType());

            if (netObjectPrefix == null)
            {
                throw new Exception(string.Format("Cannot find net object prefix for EntityType='{0}'.", (object)assignment.get_EntityType()));
            }
            object netObjectId = this.CreateNetObjectId(netObjectPrefix, assignment.get_EntityID());

            if (netObjectId == null)
            {
                throw new Exception(string.Format("Cannot create net object id from prefix '{0}' and id '{1}'.", (object)netObjectPrefix, (object)assignment.get_EntityID()));
            }
            using (IInformationServiceProxy2 iinformationServiceProxy2 = this.swisProxy.Create())
                iinformationServiceProxy2.Invoke <object>(assignment.get_EntityType(), nameof(Remanage), new object[1]
                {
                    netObjectId
                });
        }
 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);
         }
     }
 }
Beispiel #10
0
        // Token: 0x0600058A RID: 1418 RVA: 0x00021B00 File Offset: 0x0001FD00
        public void Remanage(MaintenancePlanAssignment assignment)
        {
            string netObjectPrefix = this.GetNetObjectPrefix(assignment.EntityType);

            if (netObjectPrefix == null)
            {
                throw new Exception(string.Format("Cannot find net object prefix for EntityType='{0}'.", assignment.EntityType));
            }
            object obj = this.CreateNetObjectId(netObjectPrefix, assignment.EntityID);

            if (obj == null)
            {
                throw new Exception(string.Format("Cannot create net object id from prefix '{0}' and id '{1}'.", netObjectPrefix, assignment.EntityID));
            }
            using (IInformationServiceProxy2 informationServiceProxy = this.swisProxy.Create())
            {
                informationServiceProxy.Invoke <object>(assignment.EntityType, "Remanage", new object[]
                {
                    obj
                });
            }
        }