from a10sdk.common.A10BaseClass import A10BaseClass


class Vpn(A10BaseClass):
    
    """Class Description::
    VPN Commands.

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

    :param ipsec_list: {"minItems": 1, "items": {"type": "ipsec"}, "uniqueItems": true, "array": [{"required": ["name"], "properties": {"lifebytes": {"description": "IPsec SA age in megabytes", "format": "number", "default": 0, "optional": true, "maximum": 8000000, "minimum": 0, "type": "number"}, "ike-gateway": {"description": "Gateway to use for IPsec SA", "format": "string", "minLength": 1, "optional": true, "maxLength": 31, "type": "string", "$ref": "/axapi/v3/vpn/ike-gateway"}, "name": {"description": "IPsec name", "format": "string", "minLength": 1, "optional": false, "maxLength": 31, "type": "string"}, "dh-group": {"optional": true, "enum": ["0", "1", "2", "5", "14", "15", "16", "18"], "type": "string", "description": "'0': Diffie-Hellman group 0 (Default); '1': Diffie-Hellman group 1; '2': Diffie-Hellman group 2; '5': Diffie-Hellman group 5; '14': Diffie-Hellman group 14; '15': Diffie-Hellman group 15; '16': Diffie-Hellman group 16; '18': Diffie-Hellman group 18; ", "format": "enum"}, "proto": {"description": "'esp': Encapsulating security protocol (Default); ", "format": "enum", "default": "esp", "type": "string", "enum": ["esp"], "optional": true}, "bind": {"type": "object", "properties": {"tunnel": {"description": "Tunnel interface index", "format": "number", "maximum": 128, "minimum": 1, "type": "number", "$ref": "/axapi/v3/interface/tunnel"}, "next-hop": {"type": "string", "description": "IPsec Next Hop IP Address", "format": "ipv4-address"}}}, "up": {"default": 0, "optional": true, "type": "number", "description": "Initiates SA negotiation to bring the IPsec connection up", "format": "flag"}, "anti-replay-window": {"optional": true, "enum": ["0", "16", "32", "64", "128", "256"], "type": "string", "description": "'0': Disable Anti-Replay Window Check; '16': Window Size of 16 bits; '32': Window Size of 32 bits; '64': Window Size of 64 bits; '128': Window Size of 128 bits; '256': Window Size of 256 bits; ", "format": "enum"}, "traffic-selector": {"type": "object", "properties": {"ipv4": {"type": "object", "properties": {"remote": {"type": "string", "description": "IPv4 Address", "format": "ipv4-address"}, "local_protocol": {"description": "IP Protocol Number (0-255)", "minimum": 0, "type": "number", "maximum": 255, "format": "number"}, "local_port": {"description": "Port Number", "minimum": 0, "type": "number", "maximum": 65535, "format": "number"}, "remote_port": {"description": "Port Number", "minimum": 0, "type": "number", "maximum": 65535, "format": "number"}, "local_netmask": {"type": "string", "description": "IPv4 Address Network Mask", "format": "ipv4-netmask"}, "remote_netmask": {"type": "string", "description": "IPv4 Address Network Mask", "format": "ipv4-netmask"}, "remote_protocol": {"description": "IP Protocol Number (0-255)", "minimum": 0, "type": "number", "maximum": 255, "format": "number"}, "local": {"type": "string", "description": "Local Traffic Selector", "format": "ipv4-address"}}}}}, "mode": {"description": "'tunnel': Encapsulating the packet in IPsec tunnel mode (Default); ", "format": "enum", "default": "tunnel", "type": "string", "enum": ["tunnel"], "optional": true}, "lifetime": {"description": "IPsec SA age in seconds", "format": "number", "default": 28800, "optional": true, "maximum": 28800, "minimum": 30, "type": "number"}, "enc-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"priority": {"description": "Prioritizes (1-10) security protocol, least value has highest priority", "format": "number", "default": 5, "maximum": 10, "minimum": 1, "type": "number"}, "encryption": {"enum": ["des", "3des", "aes-128", "aes-192", "aes-256", "null"], "type": "string", "description": "'des': Data Encryption Standard algorithm; '3des': Triple Data Encryption Standard algorithm; 'aes-128': Advanced Encryption Standard algorithm (key size: 128 bits); 'aes-192': Advanced Encryption Standard algorithm (key size: 192 bits); 'aes-256': Advanced Encryption Standard algorithm (key size: 256 bits); 'null': No encryption algorithm; ", "format": "enum"}, "hash": {"enum": ["md5", "sha1", "sha256", "null"], "type": "string", "description": "'md5': MD5 Dessage-Digest Algorithm; 'sha1': Secure Hash Algorithm 1; 'sha256': Secure Hash Algorithm 256; 'null': No hash algorithm; ", "format": "enum"}, "optional": true}}]}}}], "type": "array", "$ref": "/axapi/v3/vpn/ipsec/{name}"}
    :param fragment_after_encap: {"default": 0, "optional": true, "type": "number", "description": "Fragment after adding IPsec headers", "format": "flag"}
    :param revocation_list: {"minItems": 1, "items": {"type": "revocation"}, "uniqueItems": true, "array": [{"required": ["name"], "properties": {"ca": {"description": "Certificate Authority file name", "format": "string", "minLength": 1, "optional": true, "maxLength": 31, "type": "string"}, "name": {"description": "Revocation name", "format": "string", "minLength": 1, "optional": false, "maxLength": 31, "type": "string"}, "crl": {"type": "object", "properties": {"crl-sec": {"minLength": 1, "maxLength": 255, "type": "string", "description": "Secondary CRL File Name or URL (http://www.example.com/ocsp) (only .der filetypes)", "format": "string-rlx"}, "crl-pri": {"minLength": 1, "maxLength": 255, "type": "string", "description": "Primary CRL File Name or URL (http://www.example.com/ocsp) (only .der filetypes)", "format": "string-rlx"}}}, "ocsp": {"type": "object", "properties": {"ocsp-pri": {"minLength": 1, "maxLength": 31, "type": "string", "description": "Primary OCSP Authentication Server", "format": "string"}, "ocsp-sec": {"minLength": 1, "maxLength": 31, "type": "string", "description": "Secondary OCSP Authentication Server", "format": "string"}}}}}], "type": "array", "$ref": "/axapi/v3/vpn/revocation/{name}"}
    :param ike_gateway_list: {"minItems": 1, "items": {"type": "ike-gateway"}, "uniqueItems": true, "array": [{"required": ["name"], "properties": {"remote-ca-cert": {"type": "object", "properties": {"remote-cert-name": {"minLength": 1, "maxLength": 127, "type": "string", "description": "CA Certificate DN", "format": "string-rlx"}}}, "local-address": {"type": "object", "properties": {"local-ip": {"type": "string", "description": "Ipv4 address", "format": "ipv4-address"}}}, "name": {"description": "IKE-gateway name", "format": "string", "minLength": 1, "optional": false, "maxLength": 63, "type": "string"}, "dh-group": {"optional": true, "enum": ["1", "2", "5", "14", "15", "16", "18"], "type": "string", "description": "'1': Diffie-Hellman group 1 (Default); '2': Diffie-Hellman group 2; '5': Diffie-Hellman group 5; '14': Diffie-Hellman group 14; '15': Diffie-Hellman group 15; '16': Diffie-Hellman group 16; '18': Diffie-Hellman group 18; ", "format": "enum"}, "nat-traversal": {"default": 0, "optional": true, "type": "number", "format": "flag"}, "vrid": {"type": "object", "properties": {"default": {"default": 0, "not": "vrid-num", "type": "number", "description": "Default VRRP-A vrid", "format": "flag"}, "vrid-num": {"description": "Specify ha VRRP-A vrid", "format": "number", "maximum": 31, "minimum": 1, "not": "default", "type": "number"}}}, "ike-version": {"optional": true, "enum": ["v1", "v2"], "type": "string", "description": "'v1': IKEv1 key exchange; 'v2': IKEv2 key exchange; ", "format": "enum"}, "local-cert": {"type": "object", "properties": {"local-cert-name": {"minLength": 1, "maxLength": 64, "type": "string", "description": "Certificate File Name", "format": "string"}}}, "dpd": {"type": "object", "properties": {"interval": {"description": "Interval time in seconds", "minimum": 0, "type": "number", "maximum": 10, "format": "number"}, "retry": {"description": "Retry times", "minimum": 1, "type": "number", "maximum": 10, "format": "number"}}}, "mode": {"optional": true, "enum": ["main", "aggressive"], "type": "string", "description": "'main': Negotiate Main mode (Default); 'aggressive': Negotiate Aggressive mode; ", "format": "enum"}, "key": {"type": "object", "properties": {"key-passphrase": {"minLength": 1, "maxLength": 127, "type": "string", "description": "Private Key Pass Phrase", "format": "string"}, "key-name": {"minLength": 1, "maxLength": 64, "type": "string", "description": "Private Key File Name", "format": "string"}}}, "lifetime": {"description": "IKE SA age in seconds", "format": "number", "default": 86400, "optional": true, "maximum": 86400, "minimum": 300, "type": "number"}, "remote-address": {"type": "object", "properties": {"remote-ip": {"not": "dns", "type": "string", "description": "Ipv4 address", "format": "ipv4-address"}, "dns": {"description": "Remote IP based on Domain name", "format": "string", "minLength": 1, "maxLength": 128, "not": "remote-ip", "type": "string"}}}, "remote-id": {"description": "Remote Gateway Identity", "format": "string-rlx", "minLength": 1, "optional": true, "maxLength": 128, "type": "string"}, "local-id": {"description": "Local Gateway Identity", "format": "string-rlx", "minLength": 1, "optional": true, "maxLength": 128, "type": "string"}, "enc-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"priority": {"description": "Prioritizes (1-10) security protocol, least value has highest priority", "format": "number", "default": 5, "maximum": 10, "minimum": 1, "type": "number"}, "encryption": {"enum": ["des", "3des", "aes-128", "aes-192", "aes-256", "null"], "type": "string", "description": "'des': Data Encryption Standard algorithm; '3des': Triple Data Encryption Standard algorithm; 'aes-128': Advanced Encryption Standard algorithm (key size: 128 bits); 'aes-192': Advanced Encryption Standard algorithm (key size: 192 bits); 'aes-256': Advanced Encryption Standard algorithm (key size: 256 bits); 'null': No encryption algorithm; ", "format": "enum"}, "hash": {"enum": ["md5", "sha1", "sha256", "null"], "type": "string", "description": "'md5': MD5 Dessage-Digest Algorithm; 'sha1': Secure Hash Algorithm 1; 'sha256': Secure Hash Algorithm 256; 'null': No hash algorithm; ", "format": "enum"}, "optional": true}}]}, "auth-method": {"type": "object", "properties": {"preshare-key": {"description": "Authenticate the remote gateway using a pre-shared key", "format": "string", "minLength": 1, "maxLength": 127, "not": "rsa-signature", "type": "string"}, "rsa-signature": {"default": 0, "not": "preshare-key", "type": "number", "description": "Authenticate the remote gateway using an RSA certificate", "format": "flag"}}}}}], "type": "array", "$ref": "/axapi/v3/vpn/ike-gateway/{name}"}
    :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/vpn`.

    

    
    """
    def __init__(self, **kwargs):
        self.ERROR_MSG = ""
        self.required=[]
        self.b_key = "vpn"
        self.a10_url="/axapi/v3/vpn"
        self.DeviceProxy = ""
        self.ipsec_list = []
        self.fragment_after_encap = ""
        self.revocation_list = []
        self.ike_gateway_list = []

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


