From 49ad45e6861609fca1a37c97d1f8924efa4a82e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20G=C3=B3rski?= <33100242+tehAgitto@users.noreply.github.com> Date: Mon, 25 Sep 2023 11:13:15 +0200 Subject: [PATCH] Remove CiscoVPN and CiscoVPNInterface jinja files (#372) * Remove jinja files * remove uselss file * Remove jinja files * remove uselss file * Bumping version from 0.14.0 to 0.15.0 --- pyproject.toml | 2 +- vmngclient/api/templates/__init__.py | 67 ---- .../payloads/cisco_vpn/cisco_vpn_model.py | 91 ----- .../cisco_vpn/feature/cisco_vpn.json.j2 | 224 ------------ .../payloads/cisco_vpn/feature/dns.json.j2 | 86 ----- .../cisco_vpn/feature/ipv4route.json.j2 | 59 ---- .../cisco_vpn/feature/ipv6route.json.j2 | 58 --- .../cisco_vpn/feature/mapping.json.j2 | 24 -- .../cisco_vpn_interface_ethernet_model.py | 108 ------ .../cisco_vpn_interface_ethernet.json.j2 | 333 ------------------ .../feature/tunnel.json.j2 | 329 ----------------- 11 files changed, 1 insertion(+), 1380 deletions(-) delete mode 100644 vmngclient/api/templates/__init__.py delete mode 100644 vmngclient/api/templates/payloads/cisco_vpn/cisco_vpn_model.py delete mode 100644 vmngclient/api/templates/payloads/cisco_vpn/feature/cisco_vpn.json.j2 delete mode 100644 vmngclient/api/templates/payloads/cisco_vpn/feature/dns.json.j2 delete mode 100644 vmngclient/api/templates/payloads/cisco_vpn/feature/ipv4route.json.j2 delete mode 100644 vmngclient/api/templates/payloads/cisco_vpn/feature/ipv6route.json.j2 delete mode 100644 vmngclient/api/templates/payloads/cisco_vpn/feature/mapping.json.j2 delete mode 100644 vmngclient/api/templates/payloads/cisco_vpn_interface_ethernet/cisco_vpn_interface_ethernet_model.py delete mode 100644 vmngclient/api/templates/payloads/cisco_vpn_interface_ethernet/feature/cisco_vpn_interface_ethernet.json.j2 delete mode 100644 vmngclient/api/templates/payloads/cisco_vpn_interface_ethernet/feature/tunnel.json.j2 diff --git a/pyproject.toml b/pyproject.toml index e227ee8fa..ad35f71ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "vmngclient" -version = "0.14.0" +version = "0.15.0" description = "vManage SDK for Python" authors = ["kagorski "] readme = "README.md" diff --git a/vmngclient/api/templates/__init__.py b/vmngclient/api/templates/__init__.py deleted file mode 100644 index e489f2431..000000000 --- a/vmngclient/api/templates/__init__.py +++ /dev/null @@ -1,67 +0,0 @@ -"""Contains a list of feature templates. - -These feature template models are used to create and modify the templates -on the vManage server. - -In addition, they are used to convert CLI config into separate feature -templates in vManage. -""" - -# Device Template - -from vmngclient.api.templates.models.cisco_system import CiscoSystemModel - -# AAA Templates -from vmngclient.api.templates.payloads.aaa.aaa_model import AAAModel - -# Cisco VPN Templates -from vmngclient.api.templates.payloads.cisco_vpn.cisco_vpn_model import ( - DNS, - CiscoVPNModel, - GatewayType, - IPv4Route, - IPv6Route, - Mapping, - NextHop, -) - -# Cisco VPN Interface Ethernet Templates -from vmngclient.api.templates.payloads.cisco_vpn_interface_ethernet.cisco_vpn_interface_ethernet_model import ( - CiscoVpnInterfaceEthernetModel, - ColorType, - Encapsulation, - EncapType, - InterfaceName, - InterfaceType, - Tunnel, - TypeAddress, -) - -# CEdge Templates -from vmngclient.api.templates.payloads.tenant.tenant_model import TenantModel - -# Basic FeatureTemplate class - - -__all__ = [ - "DeviceTemplate", - "FeatureTemplate", - "TenantModel", - "AAAModel", - "CiscoVPNModel", - "DNS", - "Mapping", - "IPv4Route", - "IPv6Route", - "GatewayType", - "NextHop", - "CiscoSystemModel", - "CiscoVpnInterfaceEthernetModel", - "InterfaceType", - "TypeAddress", - "ColorType", - "Tunnel", - "Encapsulation", - "EncapType", - "InterfaceName", -] diff --git a/vmngclient/api/templates/payloads/cisco_vpn/cisco_vpn_model.py b/vmngclient/api/templates/payloads/cisco_vpn/cisco_vpn_model.py deleted file mode 100644 index 4dbe4a08b..000000000 --- a/vmngclient/api/templates/payloads/cisco_vpn/cisco_vpn_model.py +++ /dev/null @@ -1,91 +0,0 @@ -# vipType: ignore -from __future__ import annotations - -from enum import Enum -from pathlib import Path -from typing import TYPE_CHECKING, ClassVar, List, Optional - -from attr import define, field # type: ignore -from pydantic import validator - -from vmngclient.api.templates.feature_template import FeatureTemplate -from vmngclient.api.templates.payloads.aaa.aaa_model import VpnType - -if TYPE_CHECKING: - from vmngclient.session import vManageSession - - -class GatewayType(Enum): - NEXT_HOP = "next-hop" - NULL_0 = "null0" - VPN = "vpn" - DHCP = "dhcp" - - -@define -class Mapping: - name: str - ips: List[str] = field(factory=list) - - -@define -class DNS: - primary: str - secondary: Optional[str] = None - primaryv6: Optional[str] = None - secondaryv6: Optional[str] = None - - -@define -class NextHop: - address: str - distance: int = 1 - en_distance: bool = False - - -@define -class IPv4Route: - prefix: str - next_hop: list[NextHop] - gateway: GatewayType = field(default=GatewayType.NEXT_HOP) - - -@define -class IPv6Route: - prefixv6: str - next_hopv6: list[NextHop] - gatewayv6: GatewayType = field(default=GatewayType.NEXT_HOP) - - -class CiscoVPNModel(FeatureTemplate): - type: ClassVar[str] = "cisco_vpn" # Cisco VPN - payload_path: ClassVar[Path] = Path(__file__).parent / "feature/cisco_vpn.json.j2" - tenant_vpn: Optional[int] - tenant_org_name: Optional[str] - vpn_id: int - dns: Optional[DNS] = None - mapping: List[Mapping] = [] - ipv4route: List[IPv4Route] = [] - ipv6route: List[IPv6Route] = [] - - @validator("vpn_id") - def check_id(cls, v, values): - if v not in [VpnType.VPN_TRANSPORT.value, VpnType.VPN_MANAGMENT.value]: - if "tenant_org_name" not in values: - raise ValueError("Must enter the name of the organization.") - return v - - def generate_vpn_id(self, session: vManageSession) -> None: - self.tenant_vpn = self.vpn_id - payload = {"resourcePoolDataType": "vpn", "tenantId": self.tenant_org_name, "tenantVpn": self.tenant_vpn} - url = "/dataservice/resourcepool/resource/vpn" - response = session.put(url=url, json=payload).json() - self.vpn_id = response["deviceVpn"] - - def generate_payload(self, session: vManageSession) -> str: - if self.vpn_id not in [0, 512]: - self.generate_vpn_id(session=session) - return super().generate_payload(session) - - class Config: - arbitrary_types_allowed = True diff --git a/vmngclient/api/templates/payloads/cisco_vpn/feature/cisco_vpn.json.j2 b/vmngclient/api/templates/payloads/cisco_vpn/feature/cisco_vpn.json.j2 deleted file mode 100644 index 08da6fb48..000000000 --- a/vmngclient/api/templates/payloads/cisco_vpn/feature/cisco_vpn.json.j2 +++ /dev/null @@ -1,224 +0,0 @@ -{ - "templateName": "{{ name }}", - "templateDescription": "{{ description }}", - "templateType": "cisco_vpn", - "deviceType": [ - "vedge-C8000V" - ], - "templateMinVersion": "15.0.0", - "templateDefinition": { - "vpn-id": { - "vipObjectType": "object", - "vipType": "constant", - "vipValue": {{ vpn_id }} - }, - "name": { - "vipObjectType": "object", - "vipType": "ignore", - "vipVariableName": "vpn_name" - }, - "ecmp-hash-key": { - "layer4": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "false", - "vipVariableName": "vpn_layer4" - } - }, - "nat64-global": { - "prefix": { - "stateful": { - - } - } - }, - "nat64": { - "v4": { - "pool": { - "vipType": "ignore", - "vipValue": [ - - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "name" - ] - } - } - }, - {% if vpn_id != 0 and vpn_id != 512 %} - "tenant-vpn-id": { - "vipObjectType": "object", - "vipType": "constant", - "vipValue": {{ tenant_vpn }} - }, - "org-name": { - "vipObjectType": "object", - "vipType": "constant", - "vipValue": "{{ tenant_org_name }}" - }, - {% endif %} - "omp-admin-distance-ipv4": { - "vipObjectType": "object", - "vipType": "ignore", - "vipVariableName": "vpn_omp-admin-distance-ipv4" - }, - "omp-admin-distance-ipv6": { - "vipObjectType": "object", - "vipType": "ignore", - "vipVariableName": "vpn_omp-admin-distance-ipv6" - }, - "nat": { - "natpool": { - "vipType": "ignore", - "vipValue": [ - - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "name" - ] - }, - "port-forward": { - "vipType": "ignore", - "vipValue": [ - - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "source-port", - "translate-port", - "source-ip", - "translate-ip", - "proto" - ] - }, - "static": { - "vipType": "ignore", - "vipValue": [ - - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "source-ip", - "translate-ip" - ] - }, - "subnet-static": { - "vipType": "ignore", - "vipValue": [ - - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "source-ip-subnet", - "translate-ip-subnet" - ] - } - }, - "route-import-from": { - "vipType": "ignore", - "vipValue": [ - - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "protocol", - "source-vpn" - ] - }, - "route-import": { - "vipType": "ignore", - "vipValue": [ - - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "protocol" - ] - }, - "route-export": { - "vipType": "ignore", - "vipValue": [ - - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "protocol" - ] - }, - "host": { - {% if mapping %} - "vipType": "constant", - "vipValue": [ - {% include 'mapping.json.j2' %} - ], - {% else %} - "vipType": "ignore", - "vipValue": [ - - ], - {% endif %} - "vipObjectType": "tree", - "vipPrimaryKey": [ - "hostname" - ] - }, - "service": { - "vipType": "ignore", - "vipValue": [ - - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "svc-type" - ] - }, - "ip": { - "gre-route": { - - }, - "ipsec-route": { - - }, - {% if ipv4route %} - "route": {% include 'ipv4route.json.j2' %}, - {% endif %} - "service-route": { - - } - - }, - "ipv6": { - {% if ipv6route %} - "route": {% include 'ipv6route.json.j2' %} - {% endif %} - }, - {% if dns %} - "dns": {% include 'dns.json.j2' %}, - {% endif %} - "omp": { - "advertise": { - "vipType": "ignore", - "vipValue": [ - - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "protocol" - ] - }, - "ipv6-advertise": { - "vipType": "ignore", - "vipValue": [ - - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "protocol" - ] - } - } - }, - "factoryDefault": false -} \ No newline at end of file diff --git a/vmngclient/api/templates/payloads/cisco_vpn/feature/dns.json.j2 b/vmngclient/api/templates/payloads/cisco_vpn/feature/dns.json.j2 deleted file mode 100644 index 799b83540..000000000 --- a/vmngclient/api/templates/payloads/cisco_vpn/feature/dns.json.j2 +++ /dev/null @@ -1,86 +0,0 @@ -{ - "vipType": "constant", - "vipValue": [ - { - "role": { - "vipType": "constant", - "vipValue": "primary", - "vipObjectType": "object" - }, - "dns-addr": { - "vipType": "constant", - "vipValue": "{{ dns.primary }}", - "vipObjectType": "object" - }, - "priority-order": [ - "dns-addr", - "role" - ] - } - {% if dns.secondary %} - , - { - "role": { - "vipType": "constant", - "vipValue": "secondary", - "vipObjectType": "object" - }, - "dns-addr": { - "vipType": "constant", - "vipValue": "{{ dns.secondary }}", - "vipObjectType": "object" - }, - "priority-order": [ - "dns-addr", - "role" - ] - } - {% endif %} - {% if dns.primaryv6 %} - , - { - "role": { - "vipType": "constant", - "vipValue": "primaryv6", - "vipObjectType": "object", - "ipType": "ipv6" - }, - "dns-addr": { - "vipType": "constant", - "vipValue": "{{ dns.primaryv6 }}", - "vipObjectType": "object", - "ipType": "ipv6" - }, - "priority-order": [ - "dns-addr", - "role" - ] - } - {% endif %} - {% if dns.secondaryv6 %} - , - { - "role": { - "vipType": "constant", - "vipValue": "secondaryv6", - "vipObjectType": "object", - "ipType": "ipv6" - }, - "dns-addr": { - "vipType": "constant", - "vipValue": "{{ dns.secondaryv6 }}", - "vipObjectType": "object", - "ipType": "ipv6" - }, - "priority-order": [ - "dns-addr", - "role" - ] - } - {% endif %} - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "dns-addr" - ] -} \ No newline at end of file diff --git a/vmngclient/api/templates/payloads/cisco_vpn/feature/ipv4route.json.j2 b/vmngclient/api/templates/payloads/cisco_vpn/feature/ipv4route.json.j2 deleted file mode 100644 index 250eec3bd..000000000 --- a/vmngclient/api/templates/payloads/cisco_vpn/feature/ipv4route.json.j2 +++ /dev/null @@ -1,59 +0,0 @@ -{% for route in ipv4route %} - { - "vipType": "constant", - "vipValue": [ - { - "prefix": { - "vipObjectType": "object", - "vipType": "constant", - "vipValue": "{{ route.prefix }}", - "vipVariableName": "{{ route.gateway.value }}" - }, - {% if route.gateway.value == "next-hop" %} - "next-hop": { - "vipType": "constant", - "vipValue": [ - {% for hop in route.next_hop %} - { - "address": { - "vipObjectType": "object", - "vipType": "constant", - "vipValue": "{{ hop.address }}", - "vipVariableName": "vpn_next_hop_ip_address_{{loop.index}}" - }, - "distance": { - "vipObjectType": "object", - {% if hop.en_distance %} - "vipType": "ignore", - {% else %} - "vipType": "constant", - {% endif %} - "vipValue": {{ hop.distance }}, - "vipVariableName": "vpn_next_hop_ip_distance_{{loop.index}}" - }, - "priority-order": [ - "address", - "distance" - ] - }{% if not loop.last %},{% endif %} - {% endfor %} - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "address" - ] - }, - {% endif %} - "priority-order": [ - "prefix", - "next-hop", - "next-hop-with-track" - ] - }{% if not loop.last %},{% endif %} - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "prefix" - ] - }{% if not loop.last %},{% endif %} -{% endfor %} \ No newline at end of file diff --git a/vmngclient/api/templates/payloads/cisco_vpn/feature/ipv6route.json.j2 b/vmngclient/api/templates/payloads/cisco_vpn/feature/ipv6route.json.j2 deleted file mode 100644 index bce8662e3..000000000 --- a/vmngclient/api/templates/payloads/cisco_vpn/feature/ipv6route.json.j2 +++ /dev/null @@ -1,58 +0,0 @@ -{% for route in ipv6route %} - { - "vipType": "constant", - "vipValue": [ - { - "prefix": { - "vipObjectType": "object", - "vipType": "constant", - "vipValue": "{{ route.prefixv6 }}", - "vipVariableName": "{{ route.gatewayv6.value }}" - }, - {% if route.gatewayv6.value == "next-hop" %} - "next-hop": { - "vipType": "constant", - "vipValue": [ - {% for hop in route.next_hopv6 %} - { - "address": { - "vipObjectType": "object", - "vipType": "constant", - "vipValue": "{{ hop.address }}", - "vipVariableName": "vpn_next_hop_ipv6_address_{{loop.index}}" - }, - "distance": { - "vipObjectType": "object", - {% if hop.en_distance %} - "vipType": "ignore", - {% else %} - "vipType": "constant", - {% endif %} - "vipValue": {{ hop.distance }}, - "vipVariableName": "vpn_next_hop_ipv6_distance_{{loop.index}}" - }, - "priority-order": [ - "address", - "distance" - ] - }{% if not loop.last %},{% endif %} - {% endfor %} - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "address" - ] - }, - {% endif %} - "priority-order": [ - "prefix", - "next-hop" - ] - }{% if not loop.last %},{% endif %} - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "prefix" - ] - }{% if not loop.last %},{% endif %} -{% endfor %} \ No newline at end of file diff --git a/vmngclient/api/templates/payloads/cisco_vpn/feature/mapping.json.j2 b/vmngclient/api/templates/payloads/cisco_vpn/feature/mapping.json.j2 deleted file mode 100644 index 3fbd9ab6c..000000000 --- a/vmngclient/api/templates/payloads/cisco_vpn/feature/mapping.json.j2 +++ /dev/null @@ -1,24 +0,0 @@ -{% for host in mapping %} - { - "hostname": { - "vipObjectType": "object", - "vipType": "constant", - "vipValue": "{{ host.name }}", - "vipVariableName": "vpn_host_hostname" - }, - "ip": { - "vipObjectType": "list", - "vipType": "constant", - "vipValue": [ - {% for ip in host.ips%} - "{{ ip }}"{% if not loop.last %},{% endif %} - {% endfor %} - ], - "vipVariableName": "vpn_host_ip" - }, - "priority-order": [ - "hostname", - "ip" - ] - }{% if not loop.last %},{% endif %} -{% endfor %} \ No newline at end of file diff --git a/vmngclient/api/templates/payloads/cisco_vpn_interface_ethernet/cisco_vpn_interface_ethernet_model.py b/vmngclient/api/templates/payloads/cisco_vpn_interface_ethernet/cisco_vpn_interface_ethernet_model.py deleted file mode 100644 index d438eb295..000000000 --- a/vmngclient/api/templates/payloads/cisco_vpn_interface_ethernet/cisco_vpn_interface_ethernet_model.py +++ /dev/null @@ -1,108 +0,0 @@ -# vipType: ignore -from __future__ import annotations - -from enum import Enum -from pathlib import Path -from typing import ClassVar, Optional - -from attr import define # type: ignore - -from vmngclient.api.templates.feature_template import FeatureTemplate - - -class InterfaceType(Enum): - ETHERNET = "Ethernet" - FAST_ETHERNET = "FastEthernet" - FIVE_GIGABIT_ETHERNET = "FiveGigabitEthernet" - FORTY_GIGABIT_ETHERNET = "FortyGigabitEthernet" - GIGABIT_ETHERNET = "GigabitEthernet" - HUNDRED_GIG_E = "HundredGigE" - LOOPBACK = "Loopback" - TEN_GIGABIT_ETHERNET = "TenGigabitEthernet" - TUNNEL = "Tunnel" - TWENTY_FIVE_GIG_ET = "TwentyFiveGigE" - TWENTY_FIVE_GIGABIT_ETHERNET = "TwentyFiveGigabitEthernet" - TWO_GIGABIT_ETHERNET = "TwoGigabitEthernet" - VIRTUAL_PORT_GROU = "VirtualPortGroup" - VLAN = "Vlan" - - -class TypeAddress(Enum): - STATIC = "static" - DYNAMIC = "dynamic" - - -class ColorType(Enum): - G3 = "3g" - BIZ_INTERNET = "biz-internet" - BLUE = "blue" - BRONZE = "bronze" - CUSTOM_1 = "custom1" - CUSTOM_2 = "custom2" - CUSTOM_3 = "custom3" - DEFAULT = "default" - GOLD = "gold" - GREEN = "green" - LTE = "lte" - METRO_ETHERNET = "metro-ethernet" - MPLS = "mpls" - PRIVATE_1 = "private1" - PRIVATE_2 = "private2" - PRIVATE_3 = "private3" - PRIVATE_4 = "private4" - PRIVATE_5 = "private5" - PRIVATE_6 = "private6" - PUBLIC_INTERNET = "public-internet" - RED = "red" - SILVER = "silver" - - -class EncapType(Enum): - GRE = "gre" - IPSEC = "ipsec" - - -@define -class InterfaceName: - type: InterfaceType - number: Optional[str] = None - - -@define -class Encapsulation: - type: EncapType - preference: Optional[int] = None - weight: Optional[int] = None - - -@define -class Tunnel: - color: Optional[ColorType] = None - all: Optional[bool] = None - bgp: Optional[bool] = None - dhcp: Optional[bool] = None - dns: Optional[bool] = None - icmp: Optional[bool] = None - netconf: Optional[bool] = None - ntp: Optional[bool] = None - ospf: Optional[bool] = None - ssh: Optional[bool] = None - stun: Optional[bool] = None - https: Optional[bool] = None - snmp: Optional[bool] = None - encapsulation: list[Encapsulation] = [] - - -class CiscoVpnInterfaceEthernetModel(FeatureTemplate): - type: ClassVar[str] = "cisco_vpn_interface" # Cisco VPN Interface Ethernet - payload_path: ClassVar[Path] = Path(__file__).parent / "feature/cisco_vpn_interface_ethernet.json.j2" - interface_name: InterfaceName - shutdown: Optional[bool] - type_address: TypeAddress = TypeAddress.STATIC - ip: Optional[str] - tunnel: Optional[Tunnel] - mtu: Optional[int] - autonegotiate: Optional[bool] - - class Config: - arbitrary_types_allowed = True diff --git a/vmngclient/api/templates/payloads/cisco_vpn_interface_ethernet/feature/cisco_vpn_interface_ethernet.json.j2 b/vmngclient/api/templates/payloads/cisco_vpn_interface_ethernet/feature/cisco_vpn_interface_ethernet.json.j2 deleted file mode 100644 index 6b652d0c9..000000000 --- a/vmngclient/api/templates/payloads/cisco_vpn_interface_ethernet/feature/cisco_vpn_interface_ethernet.json.j2 +++ /dev/null @@ -1,333 +0,0 @@ -{ - "templateName": "{{ name }}", - "templateDescription": "{{ description }}", - "templateType": "cisco_vpn_interface", - "deviceType": [ - "vedge-C8000V" - ], - "templateMinVersion": "15.0.0", - "templateDefinition": { - "if-name": { - "vipObjectType": "object", - "vipType": "constant", - "vipValue": "{{ interface_name.type.value }}{% if interface_name.number is not none %}{{ interface_name.number }}{% endif %}", - "vipVariableName": "vpn_if_name" - }, - "description": { - "vipObjectType": "object", - "vipType": "ignore", - "vipVariableName": "vpn_if_description" - }, - "ip": { - {% if type_address.value == "static" %} - "address": { - "vipObjectType": "object", - {% if ip %} - "vipType": "constant", - "vipValue": "{{ ip }}", - {% else %} - "vipType": "ignore", - {% endif %} - "vipVariableName": "vpn_if_ipv4_address" - }, - {% else %} - "dhcp-client": { - "vipObjectType": "object", - "vipType": "constant", - "vipValue": "true" - }, - "dhcp-distance": { - "address": { - "vipObjectType": "object", - "vipObjectType": "object", - "vipType": "ignore", - "vipType": "ignore", - "vipValue": 1, - "vipVariableName": "vpn_if_ipv4_dhcp_distance" - } - }, - {% endif %} - "secondary-address": { - "vipType": "ignore", - "vipValue": [ - - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "address" - ] - } - }, - "dhcp-helper": { - "vipObjectType": "list", - "vipType": "ignore", - "vipVariableName": "vpn_if_dhcp_helper" - }, - "flow-control": { - - }, - "clear-dont-fragment": { - - }, - "pmtu": { - - }, - "mtu": { - "vipObjectType": "object", - {% if mtu is not none %} - "vipType": "constant", - "vipValue": {{ mtu }}, - {% else %} - "vipType": "ignore", - "vipValue": 1500, - {% endif %} - "vipVariableName": "vpn_if_ip_mtu" - }, - "static-ingress-qos": { - - }, - "tcp-mss-adjust": { - "vipObjectType": "object", - "vipType": "ignore", - "vipVariableName": "vpn_if_tcp_mss_adjust" - }, - "mac-address": { - "vipObjectType": "object", - "vipType": "ignore", - "vipVariableName": "vpn_if_mac_address" - }, - "speed": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "_empty", - "vipVariableName": "vpn_if_speed" - }, - "duplex": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "_empty", - "vipVariableName": "vpn_if_duplex" - }, - "shutdown": { - "vipObjectType": "object", - {% if shutdown is not none %} - "vipType": "constant", - "vipValue": "{{ shutdown | tojson}}", - {% else %} - "vipType": "ignore", - "vipValue": "true", - {% endif %} - "vipVariableName": "vpn_if_shutdown" - }, - "arp-timeout": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": 1200, - "vipVariableName": "vpn_if_arp_timeout" - }, - "autonegotiate": { - "vipObjectType": "object", - {% if autonegotiate is not none %} - "vipType": "constant", - "vipValue": "{{ autonegotiate | tojson}}", - {% else %} - "vipType": "ignore", - {% endif %} - "vipVariableName": "vpn_if_autonegotiate" - }, - "shaping-rate": { - "vipObjectType": "object", - "vipType": "ignore", - "vipVariableName": "rewrite_shaping_rate" - }, - "qos-map": { - "vipObjectType": "object", - "vipType": "ignore", - "vipVariableName": "qos_map" - }, - "qos-map-vpn": { - "vipObjectType": "object", - "vipType": "ignore", - "vipVariableName": "vpn-qos_map" - }, - "tracker": { - "vipObjectType": "list", - "vipType": "ignore", - "vipVariableName": "vpn_if_tracker" - }, - "bandwidth-upstream": { - "vipObjectType": "object", - "vipType": "ignore", - "vipVariableName": "vpn_if_bandwidth_upstream" - }, - "bandwidth-downstream": { - "vipObjectType": "object", - "vipType": "ignore", - "vipVariableName": "vpn_if_bandwidth_downstream" - }, - "block-non-source-ip": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "false", - "vipVariableName": "vpn_if_block_non_source_ip" - }, - "rewrite-rule": { - "rule-name": { - "vipObjectType": "object", - "vipType": "ignore", - "vipVariableName": "rewrite_rule_name" - } - }, - "tloc-extension": { - "vipObjectType": "object", - "vipType": "ignore", - "vipVariableName": "vpn_if_tloc_extension" - }, - "load-interval": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": 30, - "vipVariableName": "vpn_if_load_interval" - }, - "icmp-redirect-disable": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "true", - "vipVariableName": "vpn_if_icmp_redirect_disable" - }, - "tloc-extension-gre-from": { - "src-ip": { - "vipObjectType": "object", - "vipType": "ignore", - "vipVariableName": "vpn_if_tloc-ext_gre_from_src_ip" - }, - "xconnect": { - "vipObjectType": "object", - "vipType": "ignore", - "vipVariableName": "vpn_if_tloc-ext_gre_from_xconnect" - } - }, - "access-list": { - "vipType": "ignore", - "vipValue": [], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "direction" - ] - }, - {% if tunnel is not none %} - "tunnel-interface": {% include 'tunnel.json.j2' %}, - {% endif %} - "auto-bandwidth-detect": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "false", - "vipVariableName": "vpn_if_auto_bandwidth_detect" - }, - "iperf-server": { - "vipType": "ignore" - }, - "media-type": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "_empty", - "vipVariableName": "vpn_if_media-type" - }, - "intrf-mtu": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": 1500, - "vipVariableName": "vpn_if_intrf_mtu" - }, - "ip-directed-broadcast": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "false", - "vipVariableName": "vpn_if_ip-directed-broadcast" - }, - "trustsec": { - "enforcement": { - "enable": { - "vipObjectType": "object", - "vipType": "ignore" - }, - "sgt": { - "vipObjectType": "object", - "vipType": "ignore", - "vipVariableName": "trusted_enforcement_sgt" - } - } - }, - "ipv6": { - "access-list": { - "vipType": "ignore", - "vipValue": [ - - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "direction" - ] - }, - "address": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "", - "vipVariableName": "vpn_if_ipv6_ipv6_address" - }, - "dhcp-helper-v6": { - "vipType": "ignore", - "vipValue": [ - - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "address" - ] - }, - "secondary-address": { - "vipType": "ignore", - "vipValue": [ - - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "address" - ] - } - }, - "arp": { - "ip": { - "vipType": "ignore", - "vipValue": [ - - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "addr" - ] - } - }, - "vrrp": { - "vipType": "ignore", - "vipValue": [ - - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "grp-id" - ] - }, - "ipv6-vrrp": { - "vipType": "ignore", - "vipValue": [ - - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "grp-id" - ] - } - }, - "factoryDefault": false -} diff --git a/vmngclient/api/templates/payloads/cisco_vpn_interface_ethernet/feature/tunnel.json.j2 b/vmngclient/api/templates/payloads/cisco_vpn_interface_ethernet/feature/tunnel.json.j2 deleted file mode 100644 index 1a869feab..000000000 --- a/vmngclient/api/templates/payloads/cisco_vpn_interface_ethernet/feature/tunnel.json.j2 +++ /dev/null @@ -1,329 +0,0 @@ -{ - "encapsulation": { - "vipType": "constant", - "vipValue": [ - {% for encap in tunnel.encapsulation %} - { - "preference": { - "vipObjectType": "object", - {% if encap.preference is not none %} - "vipType": "constant", - "vipValue": {{ encap.preference }}, - {% else %} - "vipType": "ignore", - {% endif %} - "vipVariableName": "vpn_if_tunnel_{{ encap.type.value }}_preference" - }, - "weight": { - "vipObjectType": "object", - {% if encap.weight is not none %} - "vipType": "constant", - "vipValue": {{ encap.weight }}, - {% else %} - "vipType": "ignore", - "vipValue": 1, - {% endif %} - "vipVariableName": "vpn_if_tunnel_{{ encap.type.value }}_weight" - }, - "encap": { - "vipType": "constant", - "vipValue": "{{ encap.type.value }}", - "vipObjectType": "object" - }, - "priority-order": [ - "encap", - "preference", - "weight" - ] - } - {% if not loop.last %},{% endif %} - {% endfor %} - ], - "vipObjectType": "tree", - "vipPrimaryKey": [ - "encap" - ] - }, - "group": { - "vipObjectType": "list", - "vipType": "ignore", - "vipVariableName": "vpn_if_tunnel_group" - }, - "border": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "false", - "vipVariableName": "vpn_if_tunnel_border" - }, - "color": { - "value": { - "vipObjectType": "object", - {% if tunnel.color is not none %} - "vipType": "constant", - "vipValue": "{{ tunnel.color.value }}", - {% else %} - "vipType": "ignore", - "vipValue":"default", - {% endif %} - "vipVariableName": "vpn_if_tunnel_color_value" - }, - "restrict": { - "vipObjectType": "node-only", - "vipType": "ignore", - {% if tunnel.color is not none %} - "vipValue": "false", - "vipVariableName": "vpn_if_tunnel_color_restrict" - {% else %} - "vipValue": "false" - {% endif %} - } - }, - "carrier": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "default", - "vipVariableName": "vpn_if_tunnel_carrier" - }, - "bind": { - "vipObjectType": "object", - "vipType": "ignore", - "vipVariableName": "vpn_if_tunnel_bind" - }, - "allow-service": { - "dhcp": { - "vipObjectType": "object", - {% if tunnel.dhcp is not none %} - "vipType": "constant", - "vipValue": "{{ tunnel.dhcp | tojson}}", - {% else %} - "vipType": "ignore", - "vipValue": "false", - {% endif %} - "vipVariableName": "vpn_if_tunnel_dhcp" - }, - "dns": { - "vipObjectType": "object", - {% if tunnel.dns is not none %} - "vipType": "constant", - "vipValue": "{{ tunnel.dns | tojson}}", - {% else %} - "vipType": "ignore", - "vipValue": "false", - {% endif %} - "vipVariableName": "vpn_if_tunnel_dns" - }, - "icmp": { - "vipObjectType": "object", - {% if tunnel.icmp is not none %} - "vipType": "constant", - "vipValue": "{{ tunnel.icmp | tojson}}", - {% else %} - "vipType": "ignore", - "vipValue": "false", - {% endif %} - "vipVariableName": "vpn_if_tunnel_icmp" - }, - "sshd": { - "vipObjectType": "object", - {% if tunnel.ssh is not none %} - "vipType": "constant", - "vipValue": "{{ tunnel.ssh | tojson}}", - {% else %} - "vipType": "ignore", - "vipValue": "false", - {% endif %} - "vipVariableName": "vpn_if_tunnel_sshd" - }, - "ntp": { - "vipObjectType": "object", - {% if tunnel.ntp is not none %} - "vipType": "constant", - "vipValue": "{{ tunnel.ntp | tojson}}", - {% else %} - "vipType": "ignore", - "vipValue": "false", - {% endif %} - "vipVariableName": "vpn_if_tunnel_ntp" - }, - "stun": { - "vipObjectType": "object", - {% if tunnel.stun is not none %} - "vipType": "constant", - "vipValue": "{{ tunnel.stun | tojson}}", - {% else %} - "vipType": "ignore", - "vipValue": "false", - {% endif %} - "vipVariableName": "vpn_if_tunnel_stun" - }, - "all": { - "vipObjectType": "object", - {% if tunnel.all is not none %} - "vipType": "constant", - "vipValue": "{{ tunnel.all | tojson}}", - {% else %} - "vipType": "ignore", - "vipValue": "false", - {% endif %} - "vipVariableName": "vpn_if_tunnel_all" - }, - "bgp": { - "vipObjectType": "object", - {% if tunnel.bgp is not none %} - "vipType": "constant", - "vipValue": "{{ tunnel.bgp | tojson}}", - {% else %} - "vipType": "ignore", - "vipValue": "false", - {% endif %} - "vipVariableName": "vpn_if_tunnel_bgp" - }, - "ospf": { - "vipObjectType": "object", - {% if tunnel.ospf is not none %} - "vipType": "constant", - "vipValue": "{{ tunnel.ospf | tojson}}", - {% else %} - "vipType": "ignore", - "vipValue": "false", - {% endif %} - "vipVariableName": "vpn_if_tunnel_ospf" - }, - "netconf": { - "vipObjectType": "object", - {% if tunnel.netconf is not none %} - "vipType": "constant", - "vipValue": "{{ tunnel.netconf | tojson}}", - {% else %} - "vipType": "ignore", - "vipValue": "false", - {% endif %} - "vipVariableName": "vpn_if_tunnel_netconf" - }, - "snmp": { - "vipObjectType": "object", - {% if tunnel.snmp is not none %} - "vipType": "constant", - "vipValue": "{{ tunnel.snmp | tojson}}", - {% else %} - "vipType": "ignore", - "vipValue": "false", - {% endif %} - "vipVariableName": "vpn_if_tunnel_snmp" - }, - "https": { - "vipObjectType": "object", - {% if tunnel.https is not none %} - "vipType": "constant", - "vipValue": "{{ tunnel.https | tojson}}", - {% else %} - "vipType": "ignore", - "vipValue": "false", - {% endif %} - "vipVariableName": "vpn_if_tunnel_https" - } - }, - "max-control-connections": { - "vipObjectType": "object", - "vipType": "ignore", - "vipVariableName": "vpn_if_tunnel_max_control_connections" - }, - "vbond-as-stun-server": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "false", - "vipVariableName": "vpn_if_tunnel_vbond_as_stun_server" - }, - "exclude-controller-group-list": { - "vipObjectType": "list", - "vipType": "ignore", - "vipVariableName": "vpn_if_tunnel_exclude_controller_group_list" - }, - "vmanage-connection-preference": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": 5, - "vipVariableName": "vpn_if_tunnel_vmanage_connection_preference" - }, - "port-hop": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "true", - "vipVariableName": "vpn_if_tunnel_port_hop" - }, - "low-bandwidth-link": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "false", - "vipVariableName": "vpn_if_tunnel_low_bandwidth_link" - }, - "last-resort-circuit": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "false", - "vipVariableName": "vpn_if_tunnel_last_resort_circuit" - }, - "nat-refresh-interval": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": 5, - "vipVariableName": "vpn_if_tunnel_nat_refresh_interval" - }, - "hello-interval": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": 1000, - "vipVariableName": "vpn_if_tunnel_hello_interval" - }, - "hello-tolerance": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": 12, - "vipVariableName": "vpn_if_tunnel_hello_tolerance" - }, - "tloc-extension-gre-to": { - "dst-ip": { - "vipObjectType": "object", - "vipType": "ignore", - "vipVariableName": "vpn_if_tunnel_tloc_ext_gre_to_dst_ip" - } - }, - "enable-core-region": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "false" - }, - "core-region": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "core" - }, - "secondary-region": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "off" - }, - "tunnel-tcp-mss-adjust": { - "vipObjectType": "object", - "vipType": "ignore", - "vipVariableName": "vpn_if_tunnel_tunnel_tcp_mss_adjust" - }, - "clear-dont-fragment": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "false", - "vipVariableName": "vpn_if_tunnel_tunnel_clear_dont_fragment" - }, - "propagate-sgt": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "false", - "vipVariableName": "vpn_if_tunnel_tunnel_propagate_sgt" - }, - "network-broadcast": { - "vipObjectType": "object", - "vipType": "ignore", - "vipValue": "false", - "vipVariableName": "vpn_if_tunnel_tunnel_network_broadcast" - } -}