Exemple #1
0
        public GslbServer(object obj = null)
        {
            if (obj == null)
            {
                obj = new System.Collections.Generic.Dictionary <string, object> {
                };
            }
            object enabled = Util.GetByPathAny(new System.Collections.Generic.List <object> {
                obj
            }, new System.Collections.Generic.List <string> {
                "Enabled", "enabled"
            });

            this._Enabled = null;
            if (enabled != null)
            {
                string enabledStr = ((string)(enabled));
                this._Enabled = enabledStr.ToLower() == "true";
            }
            this._IpAddress = ((string)(Util.GetByPathAny(new System.Collections.Generic.List <object> {
                obj
            }, new System.Collections.Generic.List <string> {
                "IPAddress",
                "ipAddress",
                "ip_address",
                "ip"
            })));
            object weight = Util.GetByPathAny(new System.Collections.Generic.List <object> {
                obj
            }, new System.Collections.Generic.List <string> {
                "Weight", "weight"
            });

            this._Weight = null;
            if (weight != null)
            {
                this._Weight = (long)System.Convert.ToInt64("" + weight);
            }
            if (this._Weight == 0)
            {
                this._Weight = null;
            }
        }
Exemple #2
0
        public Ipv4Range(object obj = null)
        {
            if (obj == null)
            {
                obj = new System.Collections.Generic.Dictionary <string, object> {
                };
            }
            object first = Util.GetByPathAny(new System.Collections.Generic.List <object> {
                obj
            }, new System.Collections.Generic.List <string> {
                "Min", "min"
            });

            this._First = null;
            if (first != null)
            {
                this._First = ((string)(first));
            }
            if (this._First != null && this._First == "")
            {
                this._First = null;
            }
            object last = Util.GetByPathAny(new System.Collections.Generic.List <object> {
                obj
            }, new System.Collections.Generic.List <string> {
                "Max", "max"
            });

            this._Last = null;
            if (last != null)
            {
                this._Last = ((string)(last));
            }
            if (this._Last != null && this._Last == "")
            {
                this._Last = null;
            }
        }
        public LbVirtualIp(object obj = null)
        {
            if (obj == null)
            {
                obj = new System.Collections.Generic.Dictionary <string, object> {
                };
            }
            object vip = Util.GetByPathAny(new System.Collections.Generic.List <object> {
                obj
            }, new System.Collections.Generic.List <string> {
                "VirtualIPAddress",
                "virtualIpAddress",
                "virtual_ip_address",
                "vip"
            });

            this._VirtualIpAddress = ((string)(vip));
            object port = Util.GetByPathAny(new System.Collections.Generic.List <object> {
                obj
            }, new System.Collections.Generic.List <string> {
                "Port", "port"
            });

            this._Port = null;
            if (port != null)
            {
                this._Port = (long)System.Convert.ToInt64("" + port);
            }
            if (this._Port == 0)
            {
                this._Port = null;
            }
            object delayLoop = Util.GetByPathAny(new System.Collections.Generic.List <object> {
                obj
            }, new System.Collections.Generic.List <string> {
                "DelayLoop",
                "delayLoop",
                "delay_loop",
                "delay"
            });

            this._DelayLoop = null;
            if (delayLoop != null)
            {
                this._DelayLoop = (long)System.Convert.ToInt64("" + delayLoop);
            }
            if (this._DelayLoop == 0)
            {
                this._DelayLoop = null;
            }
            this._Servers = new System.Collections.Generic.List <LbServer> {
            };
            object serversDyn = Util.GetByPathAny(new System.Collections.Generic.List <object> {
                obj
            }, new System.Collections.Generic.List <string> {
                "Servers", "servers"
            });

            if (serversDyn != null)
            {
                System.Collections.Generic.List <object> servers = ((System.Collections.Generic.List <object>)(serversDyn));
                for (int __it1 = 0; __it1 < (servers as System.Collections.IList).Count; __it1++)
                {
                    var server = servers[__it1];
                    (this._Servers as System.Collections.IList).Add(new LbServer(server));
                }
            }
        }
Exemple #4
0
        public LbServer(object obj = null)
        {
            if (obj == null)
            {
                obj = new System.Collections.Generic.Dictionary <string, object> {
                };
            }
            object health = Util.GetByPathAny(new System.Collections.Generic.List <object> {
                obj
            }, new System.Collections.Generic.List <string> {
                "HealthCheck",
                "healthCheck",
                "health_check",
                "health"
            });
            object enabled = Util.GetByPathAny(new System.Collections.Generic.List <object> {
                obj
            }, new System.Collections.Generic.List <string> {
                "Enabled", "enabled"
            });

            this._Enabled = null;
            if (enabled != null)
            {
                string enabledStr = ((string)(enabled));
                this._Enabled = enabledStr.ToLower() == "true";
            }
            this._IpAddress = ((string)(Util.GetByPathAny(new System.Collections.Generic.List <object> {
                obj
            }, new System.Collections.Generic.List <string> {
                "IPAddress",
                "ipAddress",
                "ip_address",
                "ip"
            })));
            this._Protocol    = ((string)(Util.GetByPathAny(new System.Collections.Generic.List <object> {
                health, obj
            }, new System.Collections.Generic.List <string> {
                "Protocol", "protocol"
            })));
            this._PathToCheck = ((string)(Util.GetByPathAny(new System.Collections.Generic.List <object> {
                health, obj
            }, new System.Collections.Generic.List <string> {
                "Path",
                "path",
                "pathToCheck",
                "path_to_check"
            })));
            object port = Util.GetByPathAny(new System.Collections.Generic.List <object> {
                obj
            }, new System.Collections.Generic.List <string> {
                "Port", "port"
            });

            this._Port = null;
            if (port != null)
            {
                this._Port = (long)System.Convert.ToInt64("" + port);
            }
            if (this._Port == 0)
            {
                this._Port = null;
            }
            object responseExpected = Util.GetByPathAny(new System.Collections.Generic.List <object> {
                health, obj
            }, new System.Collections.Generic.List <string> {
                "Status",
                "status",
                "responseExpected",
                "response_expected"
            });

            this._ResponseExpected = null;
            if (responseExpected != null)
            {
                this._ResponseExpected = (long)System.Convert.ToInt64("" + responseExpected);
            }
            if (this._ResponseExpected == 0)
            {
                this._ResponseExpected = null;
            }
            this._ActiveConnections = 0;
            this._Status            = null;
        }