Ejemplo n.º 1
0
        protected override void ProcessRecord()
        {
            nitro_service nitroService = new nitro_service(this.IPAddress, !(bool)this.UseSSL ? "HTTP" : "HTTPS");

            if (!(nitroService.login(this.Credential.UserName, this.Credential.GetNetworkCredential().Password).sessionid != ""))
            {
                return;
            }
            if ((uint)lbvserver.add(nitroService, new lbvserver()
            {
                port = new ushort?((ushort)80),
                ipv46 = this.VIPAddress,
                name = this.Name,
                servicetype = "HTTP"
            }).errorcode <= 0U)
            {
                lbvserver _lbvserver = lbvserver.get(nitroService, this.Name);
                if (_lbvserver != null)
                {
                    NSVirtualServer nsVirtualServer = new NSVirtualServer()
                    {
                        Name        = _lbvserver.name,
                        IP          = _lbvserver.ipv46,
                        IPMask      = _lbvserver.ipmask,
                        IPPattern   = _lbvserver.ippattern,
                        ServiceType = _lbvserver.servicetype,
                        Type        = _lbvserver.type
                    };
                    nitroService.save_config();
                    this.WriteObject((object)nsVirtualServer);
                }
            }
        }
 protected override void ProcessRecord()
 {
     nitro_service nitroService = new nitro_service(this.IPAddress, !(bool)this.UseSSL ? "HTTP" : "HTTPS");
     if (!(nitroService.login(this.Credential.UserName, this.Credential.GetNetworkCredential().Password).sessionid != ""))
         return;
     if ((uint)lbvserver.add(nitroService, new lbvserver()
     {
         port = new ushort?((ushort)80),
         ipv46 = this.VIPAddress,
         name = this.Name,
         servicetype = "HTTP"
     }).errorcode <= 0U)
     {
         lbvserver _lbvserver = lbvserver.get(nitroService, this.Name);
         if (_lbvserver != null)
         {
             NSVirtualServer nsVirtualServer = new NSVirtualServer()
             {
                 Name = _lbvserver.name,
                 IP = _lbvserver.ipv46,
                 IPMask = _lbvserver.ipmask,
                 IPPattern = _lbvserver.ippattern,
                 ServiceType = _lbvserver.servicetype,
                 Type = _lbvserver.type
             };
             nitroService.save_config();
             this.WriteObject((object)nsVirtualServer);
         }
     }
 }
Ejemplo n.º 3
0
        protected override void ProcessRecord()
        {
            nitro_service service = new nitro_service(this.IPAddress, !(bool)this.UseSSL ? "HTTP" : "HTTPS");

            if (!(service.login(this.Credential.UserName, this.Credential.GetNetworkCredential().Password).sessionid != ""))
            {
                return;
            }
            List <NSVirtualServer> list = new List <NSVirtualServer>();

            foreach (lbvserver _lbvserver in lbvserver.get(service))
            {
                NSVirtualServer nsVirtualServer = new NSVirtualServer()
                {
                    Name        = _lbvserver.name,
                    IP          = _lbvserver.ipv46,
                    IPMask      = _lbvserver.ipmask,
                    IPPattern   = _lbvserver.ippattern,
                    ServiceType = _lbvserver.servicetype,
                    Type        = _lbvserver.type
                };
                list.Add(nsVirtualServer);
            }
            this.WriteObject((object)list);
        }
 protected override void ProcessRecord()
 {
     nitro_service service = new nitro_service(this.IPAddress, !(bool)this.UseSSL ? "HTTP" : "HTTPS");
     if (!(service.login(this.Credential.UserName, this.Credential.GetNetworkCredential().Password).sessionid != ""))
         return;
     List<NSIP> list = new List<NSIP>();
     foreach (nsip nsip1 in nsip.get(service))
     {
         NSIP nsip2 = new NSIP()
         {
             IP = nsip1.ipaddress,
             State = nsip1.state,
             Type = nsip1.type
         };
         list.Add(nsip2);
     }
     this.WriteObject((object)list);
 }
 protected override void ProcessRecord()
 {
     nitro_service service = new nitro_service(this.IPAddress, !(bool)this.UseSSL ? "HTTP" : "HTTPS");
     if (!(service.login(this.Credential.UserName, this.Credential.GetNetworkCredential().Password).sessionid != ""))
         return;
     List<NSVirtualServer> list = new List<NSVirtualServer>();
     foreach (lbvserver _lbvserver in lbvserver.get(service))
     {
         NSVirtualServer nsVirtualServer = new NSVirtualServer()
         {
             Name = _lbvserver.name,
             IP = _lbvserver.ipv46,
             IPMask = _lbvserver.ipmask,
             IPPattern = _lbvserver.ippattern,
             ServiceType = _lbvserver.servicetype,
             Type = _lbvserver.type
         };
         list.Add(nsVirtualServer);
     }
     this.WriteObject((object)list);
 }
Ejemplo n.º 6
0
        protected override void ProcessRecord()
        {
            nitro_service service = new nitro_service(this.IPAddress, !(bool)this.UseSSL ? "HTTP" : "HTTPS");

            if (!(service.login(this.Credential.UserName, this.Credential.GetNetworkCredential().Password).sessionid != ""))
            {
                return;
            }
            List <NSIP> list = new List <NSIP>();

            foreach (nsip nsip1 in nsip.get(service))
            {
                NSIP nsip2 = new NSIP()
                {
                    IP    = nsip1.ipaddress,
                    State = nsip1.state,
                    Type  = nsip1.type
                };
                list.Add(nsip2);
            }
            this.WriteObject((object)list);
        }