from a10sdk.common.A10BaseClass import A10BaseClass


class VirtualServer(A10BaseClass):
    
    """Class Description::
    Create a Virtual Server.

    Class virtual-server supports CRUD Operations and inherits from `common/A10BaseClass`.
    This class is the `"PARENT"` class for this module.`

    :param port_list: {"minItems": 1, "items": {"type": "port"}, "uniqueItems": true, "array": [{"required": ["port-number", "protocol"], "properties": {"reset-on-server-selection-fail": {"default": 0, "optional": true, "type": "number", "description": "Send client reset when server selection fails", "format": "flag"}, "ha-conn-mirror": {"default": 0, "optional": true, "type": "number", "description": "Enable for HA Conn sync", "format": "flag"}, "template-ftp": {"description": "FTP port template (Ftp template name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 31, "type": "string", "$ref": "/axapi/v3/slb/template/ftp"}, "protocol": {"optional": false, "enum": ["tcp", "udp", "others", "diameter", "dns-tcp", "dns-udp", "fast-http", "fix", "ftp", "ftp-proxy", "http", "https", "mlb", "mms", "mysql", "mssql", "radius", "rtsp", "sip", "sip-tcp", "sips", "smpp-tcp", "spdy", "spdys", "smtp", "ssl-proxy", "tcp-proxy", "tftp"], "type": "string", "description": "'tcp': TCP LB service; 'udp': UDP Port; 'others': for no tcp/udp protocol, do IP load balancing; 'diameter': diameter port; 'dns-tcp': DNS service over TCP; 'dns-udp': DNS service over UDP; 'fast-http': Fast HTTP Port; 'fix': FIX Port; 'ftp': File Transfer Protocol Port; 'ftp-proxy': ftp proxy port; 'http': HTTP Port; 'https': HTTPS port; 'mlb': Message based load balancing; 'mms': Microsoft Multimedia Service Port; 'mysql': mssql port; 'mssql': mssql; 'radius': Radius Port; 'rtsp': Real Time Streaming Protocol Port; 'sip': Session initiation protocol over UDP; 'sip-tcp': Session initiation protocol over TCP; 'sips': Session initiation protocol over TLS; 'smpp-tcp': SMPP service over TCP; 'spdy': spdy port; 'spdys': spdys port; 'smtp': SMTP Port; 'ssl-proxy': Generic SSL proxy; 'tcp-proxy': Generic TCP proxy; 'tftp': TFTP Port; ", "format": "enum"}, "force-routing-mode": {"default": 0, "optional": true, "type": "number", "description": "Force routing mode", "format": "flag"}, "waf-template": {"description": "WAF template (WAF Template Name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/waf/template"}, "l7-hardware-assist": {"description": "FPGA assist L7 packet parsing", "format": "flag", "default": 0, "type": "number", "optional": true, "plat-neg-list": ["non-fpga", "soft-ax"]}, "template-persist-ssl-sid": {"description": "SSL session ID persistence (Source IP Persistence Config name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 128, "type": "string", "$ref": "/axapi/v3/slb/template/persist/ssl-sid"}, "no-auto-up-on-aflex": {"default": 0, "optional": true, "type": "number", "description": "Don't automatically mark vport up when aFleX is bound", "format": "flag"}, "template-dns": {"description": "DNS template (DNS template name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/dns"}, "template-http-policy": {"description": "http-policy template (http-policy template name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/http-policy"}, "gslb-enable": {"default": 0, "optional": true, "type": "number", "description": "Enable Global Server Load Balancing", "format": "flag"}, "template-policy": {"description": "Policy Template (Policy template name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/policy"}, "use-alternate-port": {"default": 0, "optional": true, "type": "number", "description": "Use alternate virtual port", "format": "flag"}, "ipinip": {"default": 0, "optional": true, "type": "number", "description": "Enable IP in IP", "format": "flag"}, "acl-name-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"acl-name": {"description": "Apply an access list name (Named Access List)", "format": "string", "minLength": 1, "maxLength": 16, "type": "string", "$ref": "/axapi/v3/ip/access-list"}, "acl-name-src-nat-pool": {"description": "Policy based Source NAT (NAT Pool or Pool Group)", "format": "string", "minLength": 1, "maxLength": 128, "type": "string", "$ref": "/axapi/v3/ip/nat/pool"}, "optional": true, "acl-name-seq-num": {"description": "Specify ACL precedence (sequence-number)", "minimum": 1, "type": "number", "maximum": 32, "format": "number"}}}]}, "stats-data-action": {"description": "'stats-data-enable': Enable statistical data collection for virtual port; 'stats-data-disable': Disable statistical data collection for virtual port; ", "format": "enum", "default": "stats-data-enable", "type": "string", "enum": ["stats-data-enable", "stats-data-disable"], "optional": true}, "template-persist-destination-ip": {"description": "Destination IP persistence (Destination IP persistence template name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 128, "type": "string", "$ref": "/axapi/v3/slb/template/persist/destination-ip"}, "template-tcp-proxy-server": {"description": "TCP Proxy Config Server (TCP Proxy Config name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/tcp-proxy"}, "template-sip": {"description": "SIP template", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/sip"}, "template-virtual-port": {"description": "Virtual port template (Virtual port template name)", "format": "string", "default": "default", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/virtual-port"}, "conn-limit": {"description": "Connection Limit", "format": "number", "default": 8000000, "optional": true, "maximum": 8000000, "minimum": 1, "type": "number"}, "precedence": {"default": 0, "optional": true, "type": "number", "description": "Set auto NAT pool as higher precedence for source NAT", "format": "flag"}, "template-client-ssl": {"description": "Client SSL Template (Client SSL Config Name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/client-ssl"}, "template-persist-cookie": {"description": "Cookie persistence (Cookie persistence template name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 128, "type": "string", "$ref": "/axapi/v3/slb/template/persist/cookie"}, "template-tcp": {"description": "L4 TCP Template (TCP Config Name)", "format": "string", "default": "default", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/tcp"}, "template-tcp-proxy-client": {"description": "TCP Proxy Config Client (TCP Proxy Config name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/tcp-proxy"}, "template-connection-reuse": {"description": "Connection Reuse Template (Connection Reuse Template Name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 128, "type": "string", "$ref": "/axapi/v3/slb/template/connection-reuse"}, "service-group": {"description": "Bind a Service Group to this Virtual Server (Service Group Name)", "format": "string-rlx", "minLength": 1, "optional": true, "maxLength": 128, "type": "string", "$ref": "/axapi/v3/slb/service-group"}, "pool": {"description": "Specify NAT pool or pool group", "format": "string", "minLength": 1, "optional": true, "maxLength": 128, "type": "string", "$ref": "/axapi/v3/ip/nat/pool"}, "persist-type": {"optional": true, "enum": ["src-dst-ip-swap-persist", "use-src-ip-for-dst-persist", "use-dst-ip-for-src-persist"], "type": "string", "description": "'src-dst-ip-swap-persist': Create persist session after source IP and destination IP swap; 'use-src-ip-for-dst-persist': Use the source IP to create a destination persist session; 'use-dst-ip-for-src-persist': Use the destination IP to create source IP persist session; ", "format": "enum"}, "template-fix": {"description": "FIX template (FIX Template Name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/fix"}, "snat-on-vip": {"default": 0, "optional": true, "type": "number", "description": "Enable source NAT traffic against VIP", "format": "flag"}, "bucket-count": {"optional": true, "minimum": 1, "type": "number", "maximum": 256, "format": "number"}, "use-default-if-no-server": {"default": 0, "optional": true, "type": "number", "description": "Use default forwarding if server selection failed", "format": "flag"}, "syn-cookie": {"default": 0, "optional": true, "type": "number", "description": "Enable syn-cookie", "format": "flag"}, "when-down": {"default": 0, "optional": true, "type": "number", "description": "Use alternate virtual port when down", "format": "flag"}, "template-udp": {"description": "L4 UDP Template (UDP Config Name)", "format": "string", "default": "default", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/udp"}, "aflex-scripts": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"aflex": {"minLength": 1, "maxLength": 63, "type": "string", "description": "Bind aFleX Script to the Virtual Port (aFleX Script Name)", "format": "string"}, "optional": true}}]}, "acl-id-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"acl-id-seq-num": {"description": "Specify ACL precedence (sequence-number)", "minimum": 1, "type": "number", "maximum": 32, "format": "number"}, "acl-id": {"description": "ACL id VPORT", "format": "number", "maximum": 199, "minimum": 1, "type": "number", "$ref": "/axapi/v3/access-list/standard"}, "optional": true, "acl-id-src-nat-pool": {"description": "Policy based Source NAT (NAT Pool or Pool Group)", "format": "string", "minLength": 1, "maxLength": 128, "type": "string", "$ref": "/axapi/v3/ip/nat/pool"}}}]}, "alternate-port": {"description": "Alternate Virtual Port", "format": "flag", "default": 0, "optional": true, "modify-not-allowed": 1, "not": "range", "type": "number"}, "auto": {"default": 0, "optional": true, "type": "number", "description": "Configure auto NAT for the vport", "format": "flag"}, "view": {"description": "Specify a GSLB View (ID)", "format": "number", "type": "number", "maximum": 31, "minimum": 1, "optional": true}, "alternate-port-number": {"description": "Virtual Port", "format": "number", "type": "number", "maximum": 65534, "minimum": 0, "optional": true}, "port-number": {"description": "Port", "format": "number", "type": "number", "maximum": 65534, "minimum": 0, "optional": false}, "device-group": {"optional": true, "minimum": 1, "type": "number", "maximum": 64, "format": "number"}, "use-rcv-hop-for-resp": {"default": 0, "optional": true, "type": "number", "description": "Use receive hop for response to client", "format": "flag"}, "no-dest-nat": {"default": 0, "optional": true, "type": "number", "description": "Disable destination NAT", "format": "flag"}, "template-external-service": {"description": "External service template (external-service template name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/external-service"}, "template-cache": {"description": "RAM caching template (Cache Template Name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/cache"}, "extended-stats": {"default": 0, "optional": true, "type": "number", "description": "Enable extended statistics on virtual port", "format": "flag"}, "expand": {"default": 0, "optional": true, "type": "number", "description": "expand syn-cookie with timestamp and wscale", "format": "flag"}, "reset": {"default": 0, "optional": true, "type": "number", "description": "Send client reset when connection number over limit", "format": "flag"}, "req-fail": {"default": 0, "optional": true, "type": "number", "description": "Use alternate virtual port when L7 request fail", "format": "flag"}, "skip-rev-hash": {"default": 0, "optional": true, "type": "number", "description": "Skip rev tuple hash insertion", "format": "flag"}, "name": {"description": "SLB Virtual Service Name", "format": "string-rlx", "minLength": 1, "optional": true, "maxLength": 127, "type": "string"}, "template-dblb": {"description": "DBLB Template (DBLB template name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/dblb"}, "port-translation": {"default": 0, "optional": true, "type": "number", "description": "Enable port translation under no-dest-nat", "format": "flag"}, "template-smpp": {"description": "SMPP template", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/smpp"}, "clientip-sticky-nat": {"default": 0, "optional": true, "type": "number", "description": "Prefer to use same source NAT address for a client", "format": "flag"}, "template-persist-source-ip": {"description": "Source IP persistence (Source IP persistence template name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 128, "type": "string", "$ref": "/axapi/v3/slb/template/persist/source-ip"}, "serv-sel-fail": {"default": 0, "optional": true, "type": "number", "description": "Use alternate virtual port when server selection failure", "format": "flag"}, "template-diameter": {"description": "Diameter Template (diameter template name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/diameter"}, "range": {"description": "Virtual Port range (Virtual Port range value)", "format": "number", "default": 0, "optional": true, "maximum": 254, "minimum": 0, "modify-not-allowed": 1, "not": "alternate-port", "type": "number"}, "when-down-protocol2": {"default": 0, "optional": true, "type": "number", "description": "Use alternate virtual port when down", "format": "flag"}, "def-selection-if-pref-failed": {"description": "'def-selection-if-pref-failed': Use default server selection method if prefer method failed; 'def-selection-if-pref-failed-disable': Stop using default server selection method if prefer method failed; ", "format": "enum", "default": "def-selection-if-pref-failed", "type": "string", "enum": ["def-selection-if-pref-failed", "def-selection-if-pref-failed-disable"], "optional": true}, "template-tcp-proxy": {"description": "TCP Proxy Template Name", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/tcp-proxy"}, "template-smtp": {"description": "SMTP Template (SMTP Config Name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/smtp"}, "auth-cfg": {"type": "object", "properties": {"aaa-policy": {"minLength": 1, "maxLength": 63, "type": "string", "description": "Specify AAA policy name to bind to the virtual port", "format": "string"}}}, "action": {"description": "'enable': Enable; 'disable': Disable; ", "format": "enum", "default": "enable", "type": "string", "enum": ["enable", "disable"], "optional": true}, "template-http": {"description": "HTTP Template (HTTP Config Name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/http"}, "no-logging": {"default": 0, "optional": true, "type": "number", "description": "Do not log connection over limit event", "format": "flag"}, "template-server-ssl": {"description": "Server Side SSL Template (Server SSL Name)", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/server-ssl"}, "alt-protocol2": {"optional": true, "enum": ["tcp"], "type": "string", "description": "'tcp': TCP LB service; ", "format": "enum"}, "alt-protocol1": {"optional": true, "enum": ["http"], "type": "string", "description": "'http': HTTP Port; ", "format": "enum"}, "message-switching": {"default": 0, "optional": true, "type": "number", "description": "Message switching", "format": "flag"}}}], "type": "array", "$ref": "/axapi/v3/slb/virtual-server/{name}/port/{port-number}+{protocol}"}
    :param stats_data_action: {"description": "'stats-data-enable': Enable statistical data collection for virtual server; 'stats-data-disable': Disable statistical data collection for virtual server; ", "format": "enum", "default": "stats-data-enable", "type": "string", "enum": ["stats-data-enable", "stats-data-disable"], "optional": true}
    :param acl_name: {"description": "Access List name (IPv4 Access List Name)", "format": "string", "minLength": 1, "modify-not-allowed": 1, "optional": true, "maxLength": 16, "type": "string", "$ref": "/axapi/v3/ip/access-list"}
    :param enable_disable_action: {"description": "'enable': Enable Virtual Server (default); 'disable': Disable Virtual Server; 'disable-when-all-ports-down': Disable Virtual Server when all member ports are down; 'disable-when-any-port-down': Disable Virtual Server when any member port is down; ", "format": "enum", "default": "enable", "type": "string", "enum": ["enable", "disable", "disable-when-all-ports-down", "disable-when-any-port-down"], "optional": true}
    :param ip_address: {"description": "IP Address", "format": "ipv4-address", "optional": true, "not-list": ["ipv6-address", "use-if-ip"], "modify-not-allowed": 1, "type": "string"}
    :param use_if_ip: {"description": "Use Interface IP", "format": "flag", "default": 0, "optional": true, "plat-pos-list": ["soft-ax"], "not-list": ["ipv6-address", "ip-address"], "type": "number"}
    :param vrid: {"description": "Join a vrrp group (Specify ha VRRP-A vrid)", "format": "number", "type": "number", "maximum": 31, "minimum": 1, "optional": true}
    :param template_virtual_server: {"description": "Virtual server template name", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/virtual-server"}
    :param policy: {"default": 0, "optional": true, "type": "number", "description": "Policy template", "format": "flag"}
    :param arp_disable: {"default": 0, "optional": true, "type": "number", "description": "Disable Respond to Virtual Server ARP request", "format": "flag"}
    :param description: {"description": "Create a description for VIP", "format": "string-rlx", "minLength": 1, "optional": true, "maxLength": 63, "type": "string"}
    :param redistribution_flagged: {"default": 0, "optional": true, "type": "number", "description": "Flag VIP for special redistribution handling", "format": "flag"}
    :param netmask: {"optional": true, "modify-not-allowed": 1, "type": "string", "description": "IP subnet mask", "format": "ipv4-netmask-brief"}
    :param acl_id: {"description": "acl id", "format": "number", "optional": true, "maximum": 199, "minimum": 1, "modify-not-allowed": 1, "type": "number", "$ref": "/axapi/v3/access-list/standard"}
    :param ipv6_acl: {"description": "ipv6 acl name", "format": "string", "minLength": 1, "modify-not-allowed": 1, "optional": true, "maxLength": 31, "type": "string", "$ref": "/axapi/v3/ipv6/access-list"}
    :param virtual_server: {"default": 0, "optional": true, "type": "number", "description": "Virtual server template", "format": "flag"}
    :param template_logging: {"description": "NAT Logging template name", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/ip/nat/template/logging"}
    :param extended_stats: {"default": 0, "optional": true, "type": "number", "description": "Enable extended statistics on virtual server", "format": "flag"}
    :param logging: {"default": 0, "optional": true, "type": "number", "description": "NAT Logging template", "format": "flag"}
    :param name: {"description": "SLB Virtual Server Name", "format": "string-rlx", "minLength": 1, "optional": false, "maxLength": 127, "type": "string"}
    :param template_policy: {"description": "Policy template name", "format": "string", "minLength": 1, "optional": true, "maxLength": 63, "type": "string", "$ref": "/axapi/v3/slb/template/policy"}
    :param ipv6_address: {"description": "IPV6 address", "format": "ipv6-address", "optional": true, "not-list": ["ip-address", "use-if-ip"], "modify-not-allowed": 1, "type": "string"}
    :param ethernet: {"optional": true, "plat-pos-list": ["soft-ax"], "type": "number", "description": "Ethernet interface", "format": "interface"}
    :param DeviceProxy: The device proxy for REST operations and session handling. Refer to `common/device_proxy.py`

    

    URL for this object::
    `https://<Hostname|Ip address>//axapi/v3/slb/virtual-server/{name}`.

    

    
    """
    def __init__(self, **kwargs):
        self.ERROR_MSG = ""
        self.required = [ "name"]

        self.b_key = "virtual-server"
        self.a10_url="/axapi/v3/slb/virtual-server/{name}"
        self.DeviceProxy = ""
        self.port_list = []
        self.stats_data_action = ""
        self.acl_name = ""
        self.enable_disable_action = ""
        self.ip_address = ""
        self.use_if_ip = ""
        self.vrid = ""
        self.template_virtual_server = ""
        self.policy = ""
        self.arp_disable = ""
        self.description = ""
        self.redistribution_flagged = ""
        self.netmask = ""
        self.acl_id = ""
        self.ipv6_acl = ""
        self.virtual_server = ""
        self.template_logging = ""
        self.extended_stats = ""
        self.logging = ""
        self.name = ""
        self.template_policy = ""
        self.ipv6_address = ""
        self.ethernet = ""

        for keys, value in kwargs.items():
            setattr(self,keys, value)


