diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 28227d4..6ae4978 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ { "name": "Python 3", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.8-buster" + "image": "mcr.microsoft.com/vscode/devcontainers/python:3.9" // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3a9a4ea..7ab421c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,14 +12,14 @@ permissions: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up Python 3.6 - uses: actions/setup-python@v3 + - name: Set up Python 3.9 + uses: actions/setup-python@v5 with: - python-version: "3.6" + python-version: "3.9" - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/template_gen.yml b/.github/workflows/template_gen.yml index a16897b..ff48364 100644 --- a/.github/workflows/template_gen.yml +++ b/.github/workflows/template_gen.yml @@ -8,13 +8,13 @@ permissions: write-all jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up Python 3.6 - uses: actions/setup-python@v3 + - name: Set up Python 3.9 + uses: actions/setup-python@v5 with: - python-version: "3.6" + python-version: "3.9" - name: setup git config run: | git config user.name "GitHub Actions Bot" diff --git a/devicemap-schema.json b/devicemap-schema.json index d3d6c81..d911d0a 100644 --- a/devicemap-schema.json +++ b/devicemap-schema.json @@ -1,183 +1,301 @@ { - "type": "object", - "properties": { - "displayModel": { - "$comment": "If unspecified, defaults to key in skumap. Must also be unique between skumap keys and optional displayModels.", - "type": "string" - }, - "description": { - "type": "string" - }, - "clei": { - "type": "string" - }, - "part_number": { - "type": "string" - }, - "ethernet": { - "type": "array", - "items": { - "type": "object", - "allOf": [ - { - "$ref": "#/$defs/baseInterface" - } - ], - "properties": { - "name": { - "type": "string", - "pattern": "^(ge|xe|et|mgmt)-[0-9]+(-[0-9]+)?$" - }, - "type": { - "type": "string", - "enum": [ - "WAN", - "LAN", - "HASync", - "HAFabric", - "MGMT", - "UNUSED", - "IGNORE" - ] - }, - "speed": { - "type": "integer", - "minimum": 0 - }, - "address": { - "type": "string", - "pattern": "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))$" - }, - "gateway": { - "type": "string", - "pattern": "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$" + "type": "object", + "properties": { + "displayModel": { + "$comment": "If unspecified, defaults to key in skumap. Must also be unique between skumap keys and optional displayModels.", + "type": "string" + }, + "deviceType": { + "type": "string", + "enum": [ + "juniper-manufactured" + ] + }, + "description": { + "type": "string" + }, + "platformCapabilities": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "recovery-mode", + "reset-button", + "no-pci-on-forwarding-interfaces", + "interface-name-on-forwarding-interfaces" + ] + } + }, + "clei": { + "type": "string" + }, + "part_number": { + "type": "string" + }, + "ethernet": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "allOf": [ + { + "$ref": "#/$defs/baseInterface" + } + ], + "properties": { + "name": { + "type": "string", + "pattern": "^(ge|xe|et|mgmt|ap|ha)-[0-9]+(-[0-9]+)?$" + }, + "type": { + "type": "string", + "enum": [ + "WAN", + "LAN", + "HASync", + "HAFabric", + "MGMT", + "SWITCH_PARENT", + "UNUSED", + "IGNORE" + ] + }, + "speed": { + "type": "integer", + "minimum": 0 + }, + "address": { + "type": "string", + "pattern": "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))$" + }, + "gateway": { + "type": "string", + "pattern": "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$" + }, + "vlan": { + "type": "integer", + "minimum": 1, + "maximum": 4094 + }, + "poe": { + "type": "boolean" + }, + "ap": { + "type": "boolean" + } }, - "vlan": { - "type": "integer", - "minimum": 1, - "maximum": 4094 - } - }, - "required": [ - "name", - "type" - ], - "oneOf": [ - { - "properties": { - "pciAddress": { - "type": "string", - "pattern": "^[0-9a-fA-F]{4}(:[0-9a-fA-F]{2}){2}\\.[0-7]$" + "required": [ + "name", + "type" + ], + "oneOf": [ + { + "properties": { + "pciAddress": { + "type": "string", + "pattern": "^[0-9a-fA-F]{4}(:[0-9a-fA-F]{2}){2}\\.[0-7]$" + }, + "vmbusId": { + "type": "null" + }, + "parent": { + "type": "null" + } }, - "vmbusId": { + "required": [ + "pciAddress" + ] + }, + { + "properties": { + "pciAddress": { + "type": "null" + }, + "vmbusId": { + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$" + }, + "parent": { "type": "null" - } + } + }, + "required": [ + "vmbusId" + ] }, - "required": [ - "pciAddress" - ] - }, - { - "properties": { - "pciAddress": { + { + "properties": { + "pciAddress": { + "type": "null" + }, + "vmbusId": { "type": "null" + }, + "parent": { + "type": "string", + "pattern": "^fte-[0-9]+(-[0-9]+)?$" + }, + "switch_address": { + "type": "integer", + "minimum": 0 + } }, - "vmbusId": { - "type": "string", - "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$" - } + "required": [ + "parent" + ] }, - "required": [ - "vmbusId" - ] - } - ] - } - }, - "lte": { - "type": "array", - "items": { - "type": "object", - "allOf": [ - { - "$ref": "#/$defs/baseInterface" - } - ], - "properties": { - "name": { - "type": "string", - "pattern": "^lte-[0-9]+(-[0-9]+)?$" - }, - "type": { - "type": "string", - "enum": [ - "WAN", - "UNUSED", - "IGNORE" - ] - }, - "targetInterface": { - "type": "string", - "pattern": "^[^/:\\s]+$" - } - }, - "required": [ - "name", - "type", - "targetInterface" - ] - } - }, - "alias": { - "type": "object", - "properties": { - "vendor": { - "type": "string" + { + "properties": { + "pciAddress": { + "type": "null" + }, + "vmbusId": { + "type": "null" + }, + "parent": { + "type": "null" + }, + "macIndex": { + "type": "integer", + "minimum": 0, + "description": "For non-pci based, non-forwarding interfaces, this is the order to use for picking mac addresses. Only used for HA on SSR400/440 right now." + } + }, + "required": [ + "macIndex" + ] + } + ] }, - "sku": { - "type": "string" + { + "type": "object", + "allOf": [ + { + "$ref": "#/$defs/baseInterface" + } + ], + "properties": { + "name": { + "type": "string", + "pattern": "^fte-[0-9]+(-[0-9]+)?$" + }, + "linux-name": { + "type": "string" + }, + "pciAddress": { + "type": "string", + "description": "The PCI address of a switch connection, this won't be used to configure this interface.", + "pattern": "^[0-9a-fA-F]{4}(:[0-9a-fA-F]{2}){2}\\.[0-7]$" + }, + "type": { + "type": "string", + "enum": [ + "SWITCH_PARENT" + ] + } + }, + "required": [ + "name", + "type", + "linux-name", + "pciAddress" + ] } - }, - "required": [ - "vendor", - "sku" - ], - "additionalProperties": false - }, - "source": { - "type": "string" + ] } }, - "$defs": { - "baseInterface": { + "lte": { + "type": "array", + "items": { "type": "object", - "properties": { - "description": { - "type": "string" - }, - "bcpNetwork": { - "type": "object", - "description": "A set of templates that may be used to form a \"best common practice\" network", - "patternProperties": { - "^[a-zA-Z0-9]+$": { - "$ref": "#/$defs/bcpNetworkTemplate" - } - } + "allOf": [ + { + "$ref": "#/$defs/baseInterface" } - } - }, - "bcpNetworkTemplate": { - "type": "object", + ], "properties": { "name": { "type": "string", - "description": "The name of the interface when used by this BCP template" + "pattern": "^lte-[0-9]+(-[0-9]+)?$" }, - "description": { + "type": { "type": "string", - "description": "The description of the interface when used by this BCP template" + "enum": [ + "WAN", + "UNUSED", + "IGNORE" + ] + }, + "targetInterface": { + "type": "string", + "pattern": "^[^/:\\s]+$" + } + }, + "required": [ + "name", + "type", + "targetInterface" + ] + } + }, + "alias": { + "type": "object", + "properties": { + "vendor": { + "type": "string" + }, + "sku": { + "type": "string" + }, + "method": { + "type": "string", + "enum": [ + "append", + "replace" + ] + } + }, + "required": [ + "vendor", + "sku" + ], + "additionalProperties": false + }, + "source": { + "type": "string" + } + }, + "$defs": { + "baseInterface": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "bcpNetwork": { + "type": "object", + "description": "A set of templates that may be used to form a \"best common practice\" network", + "patternProperties": { + "^[a-zA-Z0-9]+$": { + "$ref": "#/$defs/bcpNetworkTemplate" + } } } } + }, + "bcpNetworkTemplate": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the interface when used by this BCP template" + }, + "description": { + "type": "string", + "description": "The description of the interface when used by this BCP template" + } + } } } +} \ No newline at end of file diff --git a/devicemaps.json b/devicemaps.json index 3dd17dc..f5752e2 100644 --- a/devicemaps.json +++ b/devicemaps.json @@ -1462,6 +1462,226 @@ } ], "lte": [] + }, + "SSR400": { + "clei": "TBD", + "part_number": "650-178218", + "deviceType": "juniper-manufactured", + "description": "Juniper SSR400 - 10 ethernet ports", + "platformCapabilities": [ + "recovery-mode", + "reset-button", + "no-pci-on-forwarding-interfaces", + "interface-name-on-forwarding-interfaces" + ], + "ethernet": [ + { + "type": "SWITCH_PARENT", + "name": "fte-0-0", + "linux-name": "esw0", + "pciAddress": "0000:01:00.0", + "description": "Internal switch port on the device" + }, + { + "type": "WAN", + "speed": 1000, + "name": "ge-0-0", + "parent": "fte-0-0", + "switch_address": 9, + "description": "SFP Port 0 labeled on the device" + }, + { + "type": "WAN", + "speed": 1000, + "name": "ge-0-1", + "parent": "fte-0-0", + "switch_address": 10, + "description": "SFP Port 1 labeled on the device" + }, + { + "type": "WAN", + "speed": 1000, + "name": "ge-0-2", + "parent": "fte-0-0", + "switch_address": 0, + "description": "Port 2 labeled on the device" + }, + { + "type": "LAN", + "speed": 1000, + "name": "ge-0-3", + "parent": "fte-0-0", + "switch_address": 1, + "description": "Port 3 labeled on the device" + }, + { + "type": "LAN", + "speed": 1000, + "name": "ge-0-4", + "parent": "fte-0-0", + "switch_address": 2, + "description": "Port 4 labeled on the device" + }, + { + "type": "LAN", + "speed": 1000, + "name": "ge-0-5", + "parent": "fte-0-0", + "switch_address": 3, + "description": "Port 5 labeled on the device" + }, + { + "type": "LAN", + "speed": 1000, + "name": "ge-0-6", + "parent": "fte-0-0", + "switch_address": 4, + "description": "Port 6 labeled on the device" + }, + { + "type": "HAFabric", + "speed": 1000, + "name": "ge-0-7", + "parent": "fte-0-0", + "switch_address": 5, + "description": "Port 7 labeled on the device" + }, + { + "type": "LAN", + "speed": 1000, + "name": "ge-0-8", + "parent": "fte-0-0", + "switch_address": 6, + "description": "Port 8 labeled on the device", + "poe": true + }, + { + "type": "LAN", + "speed": 1000, + "name": "ge-0-9", + "parent": "fte-0-0", + "switch_address": 7, + "description": "Port 9 labeled on the device", + "poe": true + }, + { + "type": "HASync", + "macIndex": 0, + "speed": 1000, + "name": "ha-0-0", + "description": "HA device interface" + } + ], + "lte": [] + }, + "SSR400-C": { + "clei": "TBD", + "part_number": "650-178220", + "description": "Juniper SSR400-C - 10 ethernet ports + 5G", + "alias": { + "vendor": "Juniper", + "sku": "SSR400" + }, + "lte": [ + { + "type": "WAN", + "name": "lte-0-0", + "description": "LTE device interface", + "targetInterface": "mhi_netdev0" + } + ] + }, + "SSR400-W-US": { + "clei": "TBD", + "part_number": "650-178219", + "description": "Juniper SSR400-W-US - 10 ethernet ports + WiFi", + "alias": { + "vendor": "Juniper", + "sku": "SSR400", + "method": "append" + }, + "ethernet": [ + { + "type": "LAN", + "speed": 1000, + "name": "ap-0-0", + "ap": true, + "parent": "fte-0-0", + "switch_address": 8, + "description": "Internal AP port on the device" + } + ] + }, + "SSR400-CW-US": { + "clei": "TBD", + "part_number": "650-178221", + "description": "Juniper SSR400-CW-US - 10 ethernet ports + 5G + WiFi", + "alias": { + "vendor": "Juniper", + "sku": "SSR400-W-US" + }, + "lte": [ + { + "type": "WAN", + "name": "lte-0-0", + "description": "LTE device interface", + "targetInterface": "mhi_netdev0" + } + ] + }, + "SSR440": { + "clei": "TBD", + "part_number": "650-178222", + "description": "Juniper SSR440 - 10 ethernet ports", + "alias": { + "vendor": "Juniper", + "sku": "SSR400" + } + }, + "SSR440-C": { + "clei": "TBD", + "part_number": "650-178223", + "description": "Juniper SSR440-C - 10 ethernet ports + 5G", + "alias": { + "vendor": "Juniper", + "sku": "SSR400-C" + } + }, + "SSR400-W-WW": { + "clei": "TBD", + "part_number": "650-178535", + "description": "Juniper SSR400-W-WW - 10 ethernet ports + WiFi", + "alias": { + "vendor": "Juniper", + "sku": "SSR400-W-US" + } + }, + "SSR400-CW-WW": { + "clei": "TBD", + "part_number": "650-178536", + "description": "Juniper SSR400-CW-WW - 10 ethernet ports + 5G + WiFi", + "alias": { + "vendor": "Juniper", + "sku": "SSR400-CW-US" + } + }, + "SSR440-2AC": { + "clei": "TBD", + "part_number": "650-178537", + "description": "Juniper SSR440-2AC - 10 ethernet ports + 2AC", + "alias": { + "vendor": "Juniper", + "sku": "SSR440" + } + }, + "SSR440-C-2AC": { + "clei": "TBD", + "part_number": "650-178538", + "description": "Juniper SSR440-C-2AC - 10 ethernet ports + 5G + 2AC", + "alias": { + "vendor": "Juniper", + "sku": "SSR440-C" + } } }, "Lenovo": { @@ -1629,4 +1849,4 @@ } } } -} +} \ No newline at end of file diff --git a/generate_templates.py b/generate_templates.py index c12b7eb..ccad4ae 100644 --- a/generate_templates.py +++ b/generate_templates.py @@ -273,15 +273,15 @@ def generate_body(devicemap): ) def_route_exists = False for index, dev_intf in enumerate(devicemap["ethernet"]): - if dev_intf["type"] == "MGMT": + if dev_intf["type"] in ["MGMT", "SWITCH_PARENT"]: continue - intf = { - "pciAddress": dev_intf["pciAddress"], + intf = {"pciAddress": dev_intf["pciAddress"]} if dev_intf.get("pciAddress") else {} + intf.update({ "description": dev_intf["description"], "enabled": "true", "forwarding": "true", "name": dev_intf["name"] - } + }) if dev_intf["type"] == "WAN": intf["networkInterface"] = [ { @@ -424,8 +424,10 @@ def img_exists(vendor, model): def resolve_alias(devicemap, sku_map): if not devicemap.get("alias"): return devicemap + if not (devicemap.get("ethernet") or devicemap.get("lte")): return None + alias_map = resolve_alias( lookup_devicemap( devicemap["alias"]["vendor"], @@ -434,7 +436,25 @@ def resolve_alias(devicemap, sku_map): ), sku_map, ) + method = devicemap["alias"].get("method", "") + del devicemap["alias"] + + if not alias_map.get("ethernet"): + alias_map["ethernet"] = [] + if not alias_map.get("lte"): + alias_map["lte"] = [] + + if method.lower() == "append": + try: + alias_map["ethernet"].extend(devicemap.pop("ethernet")) + except KeyError: + pass + try: + alias_map["lte"].extend(devicemap.pop("lte")) + except KeyError: + pass + alias_map.update(devicemap) return alias_map diff --git a/mist_convert.py b/mist_convert.py new file mode 100644 index 0000000..fc74947 --- /dev/null +++ b/mist_convert.py @@ -0,0 +1,172 @@ +import click +import copy +import json +import pathlib + + +DEVICEMAP_PATH = pathlib.Path("./") / "devicemaps.json" + +MODEL_TEMPLATE = { + "model": "", + "type": "gateway", + "description": "", + "t128_device": True, + "has_oob": False, + "_sub_required": "wan", + "ha_node1_fpc": 1, + "ports": {}, + "defaults": {}, +} + +@click.command() +@click.option( + "-v", + "--vendor", + type=str, + required=True +) +@click.option( + "-s", + "--skus", + type=str, + required=True +) +def run(vendor, skus): + output = [] + for sku in skus.split(","): + model = convert_sku(vendor, sku.strip()) + if model: + output.append(model) + + print(json.dumps(output, indent=4)) + +def convert_sku(vendor, sku): + sku_map = json.loads(pathlib.Path(DEVICEMAP_PATH).read_text()) + + devicemap, _, actual_sku = lookup_devicemap(vendor, sku, sku_map) + if not devicemap: + return + + actual_devicemap = resolve_alias(devicemap, sku_map) + + model = copy.deepcopy(MODEL_TEMPLATE) + model["model"] = actual_sku + model["description"] = actual_devicemap.get("description") + model.update(generate_ports(actual_devicemap)) + + return model + + +def generate_ports(devicemap): + has_oobm = False + has_ha = False + port_dict = {} + wan = [] + lan = [] + for port in devicemap.get("ethernet"): + p_type = port.get("type") + if p_type == "SWITCH_PARENT": + continue + name = convert_port_name(port["name"], p_type=="MGMT") + has_oobm = has_oobm or p_type == "MGMT" + has_ha = has_ha or p_type == "HASync" + if p_type == "WAN": + wan.append(name) + if p_type == "LAN": + lan.append(name) + + p_dict = {"display": name} + if port.get("pciAddress"): + p_dict["pci_address"] = port.get("pciAddress") + if port.get("speed"): + p_dict["speed"] = port.get("speed") + port_dict[name] = p_dict + + return { + "ports": port_dict, + "has_oob": has_oobm, + "ha_node1_fpc": 1 if has_ha else 0, + "defaults": { + "wan_ports": ",".join(wan), + # "lan_ports": ",".join(lan) commented until mist bug is fixed + "lan_ports": lan[0] + } + } + + + + + + + + + +def convert_port_name(name, is_mgmt=False): + parts = name.split("-") + identifier = parts.pop(0) + if not is_mgmt: + parts.insert(0, "0") + location = "/".join(parts) + + return f"{identifier}-{location}" + + + + + +def resolve_alias(devicemap, sku_map): + if not devicemap.get("alias"): + return devicemap + child_map, _, _ = lookup_devicemap( + devicemap["alias"]["vendor"], + devicemap["alias"]["sku"], + sku_map, + ) + alias_map = resolve_alias( + child_map, + sku_map, + ) + method = devicemap["alias"].get("method", "") + + del devicemap["alias"] + + if not alias_map.get("ethernet"): + alias_map["ethernet"] = [] + if not alias_map.get("lte"): + alias_map["lte"] = [] + + if method.lower() == "append": + try: + alias_map["ethernet"].extend(devicemap.pop("ethernet")) + except KeyError: + pass + try: + alias_map["lte"].extend(devicemap.pop("lte")) + except KeyError: + pass + + alias_map.update(devicemap) + return alias_map + +def lookup_devicemap(vendor, sku, sku_map): + actual_vendor = _lookup_longest_prefix_from_map(sku_map["interfaceMap"], vendor) + if not actual_vendor: + print(f"Vendor '{vendor}' not found") + return None, None, None + acutal_sku = _lookup_longest_prefix_from_map( + sku_map["interfaceMap"][actual_vendor], + sku, + ) + if not acutal_sku: + print(f"Sku '{sku}' for vendor '{vendor}' not found") + return None, None, None + return sku_map["interfaceMap"][actual_vendor][acutal_sku], actual_vendor, acutal_sku + +def _lookup_longest_prefix_from_map(sku_map, target_key): + target_key = target_key.lower() + possible = [key for key in sku_map.keys() if target_key.startswith(key.lower())] + possible.sort(reverse=True) + return possible[0] if len(possible) > 0 else None + +if __name__ == "__main__": + run() \ No newline at end of file diff --git a/templates/Juniper-SSR400-C-template.json b/templates/Juniper-SSR400-C-template.json new file mode 100644 index 0000000..723b6e4 --- /dev/null +++ b/templates/Juniper-SSR400-C-template.json @@ -0,0 +1,229 @@ +{ + "name": "Juniper-SSR400-C-Template", + "description": "Adds a standalone Juniper SSR400-C router: Juniper SSR400-C - 10 ethernet ports + 5G", + "enabled": true, + "persistInput": false, + "builtin": true, + "mode": "advanced", + "help": "# Juniper SSR400-C Router\n\nThis adds a basic Juniper SSR400-C Session Smart Router to your configuration.\nLTE is available on your platform.\n\n\n\n##Generate Config\nSelect the generate config icon at the top of the page, and proceed to configuration. Validate and commit to finish adding the new router to running configuration.\n\n## Port Details\nThis template assumes all WAN interfaces on your device will be connected to a network providing it DHCP address assignment, and with connectivity to your conductor.\n\nIt will configure LAN interfaces providing a DHCP server to connected endpoints. From the LAN, the router local GUI and CLI will be accessible at `192.168.128.1`\n\n", + "body": "{% editgroup %}\n\n{\n \"authority\": {\n \"security\": [\n {\n \"name\": \"internal-encrypt-hmac-disable\",\n \"description\": \"Security policy built by builtin router template\",\n \"encrypt\": \"false\",\n \"adaptiveEncryption\": \"false\",\n \"hmacMode\": \"disabled\"\n }\n ],\n \"router\": [\n {\n \"_value\": {\n \"name\": \"{{routerName}}\",\n \"description\": \"{{routerDescription}}\",\n \"location\": \"{{routerLocation}}\",\n \"interNodeSecurity\": \"internal-encrypt-hmac-disable\",\n \"system\": {\n \"ntp\": {\n \"server\": [\n {\n \"ipAddress\": \"216.239.35.0\"\n },\n {\n \"ipAddress\": \"216.239.35.4\"\n },\n {\n \"ipAddress\": \"216.239.35.8\"\n },\n {\n \"ipAddress\": \"216.239.35.12\"\n }\n ]\n }\n },\n \"dnsConfig\": [\n {\n \"mode\": \"static\",\n \"address\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ],\n \"applicationIdentification\": {\n \"mode\": [\n \"all\"\n ]\n },\n \"node\": [\n {\n \"name\": \"node1\",\n \"role\": \"combo\",\n \"description\": \"{{routerName}} router node\",\n \"deviceInterface\": [\n {\n \"name\": \"lte-0-0\",\n \"description\": \"LTE device interface\",\n \"type\": \"lte\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"targetInterface\": \"mhi_netdev0\",\n \"networkInterface\": [\n {\n \"name\": \"lte-0-0\",\n \"description\": \"\",\n \"sourceNat\": \"true\",\n \"management\": \"false\",\n \"defaultRoute\": \"false\",\n \"managementVector\": {\n \"priority\": \"200\",\n \"name\": \"mgmt\"\n },\n \"dhcp\": \"v4\"\n }\n ]\n },\n {\n \"description\": \"SFP Port 0 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-0\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-0 Network Interface\",\n \"description\": \"\",\n \"sourceNat\": \"true\",\n \"dhcp\": \"v4\",\n \"conductor\": \"true\",\n \"management\": \"true\",\n \"defaultRoute\": \"true\",\n \"managementVector\": {\n \"priority\": \"101\",\n \"name\": \"mgmt\"\n }\n }\n ]\n },\n {\n \"description\": \"SFP Port 1 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-1\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-1 Network Interface\",\n \"description\": \"\",\n \"sourceNat\": \"true\",\n \"dhcp\": \"v4\",\n \"conductor\": \"true\",\n \"management\": \"true\",\n \"defaultRoute\": false,\n \"managementVector\": {\n \"priority\": \"102\",\n \"name\": \"mgmt\"\n }\n }\n ]\n },\n {\n \"description\": \"Port 2 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-2\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-2 Network Interface\",\n \"description\": \"\",\n \"sourceNat\": \"true\",\n \"dhcp\": \"v4\",\n \"conductor\": \"true\",\n \"management\": \"true\",\n \"defaultRoute\": false,\n \"managementVector\": {\n \"priority\": \"103\",\n \"name\": \"mgmt\"\n }\n }\n ]\n },\n {\n \"description\": \"Port 3 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-3\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-3 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"Port 4 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-4\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-4 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"Port 5 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-5\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-5 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"Port 6 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-6\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-6 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"Port 7 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-7\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-7 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"Port 8 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-8\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-8 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"Port 9 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-9\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-9 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"HA device interface\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ha-0-0\",\n \"networkInterface\": [\n {\n \"name\": \"ha-0-0 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n },\n \"_operation\": \"create\"\n }\n ]\n }\n}", + "schema": { + "type": "object", + "definitions": { + "wanPort": { + "type": "object", + "properties": { + "conductor": { + "title": "Conductor can be reached from this interface", + "type": "boolean", + "default": true, + "readOnly": true + }, + "dhcpClient": { + "title": "Address learned using DHCP", + "type": "boolean", + "default": true, + "readOnly": true + } + }, + "dependencies": { + "dhcpClient": { + "oneOf": [ + { + "properties": { + "dhcpClient": { + "const": true, + "readOnly": true + } + } + }, + { + "properties": { + "dhcpClient": { + "const": false, + "readOnly": true + }, + "address": { + "title": "IP address", + "type": "string", + "description": "Network interface IP address. Example: 128.128.128.2", + "readOnly": true + }, + "prefix": { + "title": "Prefix", + "type": "string", + "description": "Network prefix length. Example: 24", + "readOnly": true + }, + "gateway": { + "title": "Gateway", + "type": "string", + "description": "Network gateway IP address. Example: 128.128.128.1", + "readOnly": true + } + } + } + ] + }, + "dhcpServer": { + "oneOf": [ + { + "properties": { + "dhcpServer": { + "const": true, + "readOnly": true + }, + "dhcpServerStartAddr": { + "title": "DHCP server pool start address", + "type": "string", + "default": "192.168.128.100", + "readOnly": true + }, + "dhcpServerEndAddr": { + "title": "DHCP server pool end address", + "type": "string", + "default": "192.168.128.254", + "readOnly": true + } + } + }, + { + "properties": { + "dhcpServer": { + "const": false, + "readOnly": true + } + } + } + ] + } + } + }, + "lanPort": { + "type": "object", + "properties": { + "web": { + "title": "Management GUI", + "description": "Enable web access to the node management GUI using HTTPS.", + "type": "boolean", + "default": true, + "readOnly": true + }, + "ssh": { + "title": "Management SSH", + "description": "Enable terminal access to the node management CLI using SSH.", + "type": "boolean", + "default": true, + "readOnly": true + }, + "dhcpServer": { + "title": "DHCP Server", + "description": "Enable DHCP server on the interface.", + "type": "boolean", + "default": true, + "readOnly": true + } + } + }, + "ltePort": { + "type": "object", + "properties": {} + }, + "mgmtPort": { + "type": "object", + "properties": {} + } + }, + "title": "New Juniper SSR400-C branch router", + "description": "Add a new Juniper SSR400-C branch router to the configuration.", + "properties": { + "routerName": { + "title": "Router Name", + "description": "Enter a name identifier for the router.", + "type": "string" + }, + "routerDescription": { + "title": "Description", + "description": "Description for the router.", + "type": "string" + }, + "routerLocation": { + "title": "Site Location", + "description": "Enter the address or location of the router. Example: City, State.", + "type": "string" + }, + "ports": { + "type": "object", + "title": "Ports", + "description": "Port and network settings.", + "properties": { + "fte-0-0": { + "title": "LAN - fte-0-0", + "description": "Internal switch port on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-0": { + "title": "WAN - ge-0-0", + "description": "SFP Port 0 labeled on the device", + "$ref": "#/definitions/wanPort" + }, + "ge-0-1": { + "title": "WAN - ge-0-1", + "description": "SFP Port 1 labeled on the device", + "$ref": "#/definitions/wanPort" + }, + "ge-0-2": { + "title": "WAN - ge-0-2", + "description": "Port 2 labeled on the device", + "$ref": "#/definitions/wanPort" + }, + "ge-0-3": { + "title": "LAN - ge-0-3", + "description": "Port 3 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-4": { + "title": "LAN - ge-0-4", + "description": "Port 4 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-5": { + "title": "LAN - ge-0-5", + "description": "Port 5 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-6": { + "title": "LAN - ge-0-6", + "description": "Port 6 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-7": { + "title": "LAN - ge-0-7", + "description": "Port 7 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-8": { + "title": "LAN - ge-0-8", + "description": "Port 8 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-9": { + "title": "LAN - ge-0-9", + "description": "Port 9 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ha-0-0": { + "title": "LAN - ha-0-0", + "description": "HA device interface", + "$ref": "#/definitions/lanPort" + }, + "lte-0-0": { + "title": "WAN - lte-0-0", + "description": "LTE device interface", + "$ref": "#/definitions/wanPort" + } + } + } + } + } +} \ No newline at end of file diff --git a/templates/Juniper-SSR400-CW-US-template.json b/templates/Juniper-SSR400-CW-US-template.json new file mode 100644 index 0000000..be2ea4a --- /dev/null +++ b/templates/Juniper-SSR400-CW-US-template.json @@ -0,0 +1,169 @@ +{ + "name": "Juniper-SSR400-CW-US-Template", + "description": "Adds a standalone Juniper SSR400-CW-US router: Juniper SSR400-CW-US - 10 ethernet ports + 5G + WiFi", + "enabled": true, + "persistInput": false, + "builtin": true, + "mode": "advanced", + "help": "# Juniper SSR400-CW-US Router\n\nThis adds a basic Juniper SSR400-CW-US Session Smart Router to your configuration.\nLTE is available on your platform.\n\n\n\n##Generate Config\nSelect the generate config icon at the top of the page, and proceed to configuration. Validate and commit to finish adding the new router to running configuration.\n\n## Port Details\nThis template assumes all WAN interfaces on your device will be connected to a network providing it DHCP address assignment, and with connectivity to your conductor.\n\nIt will configure LAN interfaces providing a DHCP server to connected endpoints. From the LAN, the router local GUI and CLI will be accessible at `192.168.128.1`\n\n", + "body": "{% editgroup %}\n\n{\n \"authority\": {\n \"security\": [\n {\n \"name\": \"internal-encrypt-hmac-disable\",\n \"description\": \"Security policy built by builtin router template\",\n \"encrypt\": \"false\",\n \"adaptiveEncryption\": \"false\",\n \"hmacMode\": \"disabled\"\n }\n ],\n \"router\": [\n {\n \"_value\": {\n \"name\": \"{{routerName}}\",\n \"description\": \"{{routerDescription}}\",\n \"location\": \"{{routerLocation}}\",\n \"interNodeSecurity\": \"internal-encrypt-hmac-disable\",\n \"system\": {\n \"ntp\": {\n \"server\": [\n {\n \"ipAddress\": \"216.239.35.0\"\n },\n {\n \"ipAddress\": \"216.239.35.4\"\n },\n {\n \"ipAddress\": \"216.239.35.8\"\n },\n {\n \"ipAddress\": \"216.239.35.12\"\n }\n ]\n }\n },\n \"dnsConfig\": [\n {\n \"mode\": \"static\",\n \"address\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ],\n \"applicationIdentification\": {\n \"mode\": [\n \"all\"\n ]\n },\n \"node\": [\n {\n \"name\": \"node1\",\n \"role\": \"combo\",\n \"description\": \"{{routerName}} router node\",\n \"deviceInterface\": [\n {\n \"name\": \"lte-0-0\",\n \"description\": \"LTE device interface\",\n \"type\": \"lte\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"targetInterface\": \"mhi_netdev0\",\n \"networkInterface\": [\n {\n \"name\": \"lte-0-0\",\n \"description\": \"\",\n \"sourceNat\": \"true\",\n \"management\": \"false\",\n \"defaultRoute\": \"false\",\n \"managementVector\": {\n \"priority\": \"200\",\n \"name\": \"mgmt\"\n },\n \"dhcp\": \"v4\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"_operation\": \"create\"\n }\n ]\n }\n}", + "schema": { + "type": "object", + "definitions": { + "wanPort": { + "type": "object", + "properties": { + "conductor": { + "title": "Conductor can be reached from this interface", + "type": "boolean", + "default": true, + "readOnly": true + }, + "dhcpClient": { + "title": "Address learned using DHCP", + "type": "boolean", + "default": true, + "readOnly": true + } + }, + "dependencies": { + "dhcpClient": { + "oneOf": [ + { + "properties": { + "dhcpClient": { + "const": true, + "readOnly": true + } + } + }, + { + "properties": { + "dhcpClient": { + "const": false, + "readOnly": true + }, + "address": { + "title": "IP address", + "type": "string", + "description": "Network interface IP address. Example: 128.128.128.2", + "readOnly": true + }, + "prefix": { + "title": "Prefix", + "type": "string", + "description": "Network prefix length. Example: 24", + "readOnly": true + }, + "gateway": { + "title": "Gateway", + "type": "string", + "description": "Network gateway IP address. Example: 128.128.128.1", + "readOnly": true + } + } + } + ] + }, + "dhcpServer": { + "oneOf": [ + { + "properties": { + "dhcpServer": { + "const": true, + "readOnly": true + }, + "dhcpServerStartAddr": { + "title": "DHCP server pool start address", + "type": "string", + "default": "192.168.128.100", + "readOnly": true + }, + "dhcpServerEndAddr": { + "title": "DHCP server pool end address", + "type": "string", + "default": "192.168.128.254", + "readOnly": true + } + } + }, + { + "properties": { + "dhcpServer": { + "const": false, + "readOnly": true + } + } + } + ] + } + } + }, + "lanPort": { + "type": "object", + "properties": { + "web": { + "title": "Management GUI", + "description": "Enable web access to the node management GUI using HTTPS.", + "type": "boolean", + "default": true, + "readOnly": true + }, + "ssh": { + "title": "Management SSH", + "description": "Enable terminal access to the node management CLI using SSH.", + "type": "boolean", + "default": true, + "readOnly": true + }, + "dhcpServer": { + "title": "DHCP Server", + "description": "Enable DHCP server on the interface.", + "type": "boolean", + "default": true, + "readOnly": true + } + } + }, + "ltePort": { + "type": "object", + "properties": {} + }, + "mgmtPort": { + "type": "object", + "properties": {} + } + }, + "title": "New Juniper SSR400-CW-US branch router", + "description": "Add a new Juniper SSR400-CW-US branch router to the configuration.", + "properties": { + "routerName": { + "title": "Router Name", + "description": "Enter a name identifier for the router.", + "type": "string" + }, + "routerDescription": { + "title": "Description", + "description": "Description for the router.", + "type": "string" + }, + "routerLocation": { + "title": "Site Location", + "description": "Enter the address or location of the router. Example: City, State.", + "type": "string" + }, + "ports": { + "type": "object", + "title": "Ports", + "description": "Port and network settings.", + "properties": { + "lte-0-0": { + "title": "WAN - lte-0-0", + "description": "LTE device interface", + "$ref": "#/definitions/wanPort" + } + } + } + } + } +} \ No newline at end of file diff --git a/templates/Juniper-SSR400-W-US-template.json b/templates/Juniper-SSR400-W-US-template.json new file mode 100644 index 0000000..82806bd --- /dev/null +++ b/templates/Juniper-SSR400-W-US-template.json @@ -0,0 +1,234 @@ +{ + "name": "Juniper-SSR400-W-US-Template", + "description": "Adds a standalone Juniper SSR400-W-US router: Juniper SSR400-W-US - 10 ethernet ports + WiFi", + "enabled": true, + "persistInput": false, + "builtin": true, + "mode": "advanced", + "help": "# Juniper SSR400-W-US Router\n\nThis adds a basic Juniper SSR400-W-US Session Smart Router to your configuration.\nLTE is available on your platform.\n\n\n\n##Generate Config\nSelect the generate config icon at the top of the page, and proceed to configuration. Validate and commit to finish adding the new router to running configuration.\n\n## Port Details\nThis template assumes all WAN interfaces on your device will be connected to a network providing it DHCP address assignment, and with connectivity to your conductor.\n\nIt will configure LAN interfaces providing a DHCP server to connected endpoints. From the LAN, the router local GUI and CLI will be accessible at `192.168.128.1`\n\n", + "body": "{% editgroup %}\n\n{\n \"authority\": {\n \"security\": [\n {\n \"name\": \"internal-encrypt-hmac-disable\",\n \"description\": \"Security policy built by builtin router template\",\n \"encrypt\": \"false\",\n \"adaptiveEncryption\": \"false\",\n \"hmacMode\": \"disabled\"\n }\n ],\n \"router\": [\n {\n \"_value\": {\n \"name\": \"{{routerName}}\",\n \"description\": \"{{routerDescription}}\",\n \"location\": \"{{routerLocation}}\",\n \"interNodeSecurity\": \"internal-encrypt-hmac-disable\",\n \"system\": {\n \"ntp\": {\n \"server\": [\n {\n \"ipAddress\": \"216.239.35.0\"\n },\n {\n \"ipAddress\": \"216.239.35.4\"\n },\n {\n \"ipAddress\": \"216.239.35.8\"\n },\n {\n \"ipAddress\": \"216.239.35.12\"\n }\n ]\n }\n },\n \"dnsConfig\": [\n {\n \"mode\": \"static\",\n \"address\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ],\n \"applicationIdentification\": {\n \"mode\": [\n \"all\"\n ]\n },\n \"node\": [\n {\n \"name\": \"node1\",\n \"role\": \"combo\",\n \"description\": \"{{routerName}} router node\",\n \"deviceInterface\": [\n {\n \"name\": \"lte-0-0\",\n \"description\": \"LTE device interface\",\n \"type\": \"lte\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"targetInterface\": \"mhi_netdev0\",\n \"networkInterface\": [\n {\n \"name\": \"lte-0-0\",\n \"description\": \"\",\n \"sourceNat\": \"true\",\n \"management\": \"false\",\n \"defaultRoute\": \"false\",\n \"managementVector\": {\n \"priority\": \"200\",\n \"name\": \"mgmt\"\n },\n \"dhcp\": \"v4\"\n }\n ]\n },\n {\n \"description\": \"SFP Port 0 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-0\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-0 Network Interface\",\n \"description\": \"\",\n \"sourceNat\": \"true\",\n \"dhcp\": \"v4\",\n \"conductor\": \"true\",\n \"management\": \"true\",\n \"defaultRoute\": \"true\",\n \"managementVector\": {\n \"priority\": \"101\",\n \"name\": \"mgmt\"\n }\n }\n ]\n },\n {\n \"description\": \"SFP Port 1 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-1\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-1 Network Interface\",\n \"description\": \"\",\n \"sourceNat\": \"true\",\n \"dhcp\": \"v4\",\n \"conductor\": \"true\",\n \"management\": \"true\",\n \"defaultRoute\": false,\n \"managementVector\": {\n \"priority\": \"102\",\n \"name\": \"mgmt\"\n }\n }\n ]\n },\n {\n \"description\": \"Port 2 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-2\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-2 Network Interface\",\n \"description\": \"\",\n \"sourceNat\": \"true\",\n \"dhcp\": \"v4\",\n \"conductor\": \"true\",\n \"management\": \"true\",\n \"defaultRoute\": false,\n \"managementVector\": {\n \"priority\": \"103\",\n \"name\": \"mgmt\"\n }\n }\n ]\n },\n {\n \"description\": \"Port 3 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-3\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-3 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"Port 4 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-4\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-4 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"Port 5 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-5\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-5 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"Port 6 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-6\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-6 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"Port 7 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-7\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-7 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"Port 8 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-8\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-8 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"Port 9 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-9\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-9 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"HA device interface\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ha-0-0\",\n \"networkInterface\": [\n {\n \"name\": \"ha-0-0 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"Internal AP port on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ap-0-0\",\n \"networkInterface\": [\n {\n \"name\": \"ap-0-0 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n },\n \"_operation\": \"create\"\n }\n ]\n }\n}", + "schema": { + "type": "object", + "definitions": { + "wanPort": { + "type": "object", + "properties": { + "conductor": { + "title": "Conductor can be reached from this interface", + "type": "boolean", + "default": true, + "readOnly": true + }, + "dhcpClient": { + "title": "Address learned using DHCP", + "type": "boolean", + "default": true, + "readOnly": true + } + }, + "dependencies": { + "dhcpClient": { + "oneOf": [ + { + "properties": { + "dhcpClient": { + "const": true, + "readOnly": true + } + } + }, + { + "properties": { + "dhcpClient": { + "const": false, + "readOnly": true + }, + "address": { + "title": "IP address", + "type": "string", + "description": "Network interface IP address. Example: 128.128.128.2", + "readOnly": true + }, + "prefix": { + "title": "Prefix", + "type": "string", + "description": "Network prefix length. Example: 24", + "readOnly": true + }, + "gateway": { + "title": "Gateway", + "type": "string", + "description": "Network gateway IP address. Example: 128.128.128.1", + "readOnly": true + } + } + } + ] + }, + "dhcpServer": { + "oneOf": [ + { + "properties": { + "dhcpServer": { + "const": true, + "readOnly": true + }, + "dhcpServerStartAddr": { + "title": "DHCP server pool start address", + "type": "string", + "default": "192.168.128.100", + "readOnly": true + }, + "dhcpServerEndAddr": { + "title": "DHCP server pool end address", + "type": "string", + "default": "192.168.128.254", + "readOnly": true + } + } + }, + { + "properties": { + "dhcpServer": { + "const": false, + "readOnly": true + } + } + } + ] + } + } + }, + "lanPort": { + "type": "object", + "properties": { + "web": { + "title": "Management GUI", + "description": "Enable web access to the node management GUI using HTTPS.", + "type": "boolean", + "default": true, + "readOnly": true + }, + "ssh": { + "title": "Management SSH", + "description": "Enable terminal access to the node management CLI using SSH.", + "type": "boolean", + "default": true, + "readOnly": true + }, + "dhcpServer": { + "title": "DHCP Server", + "description": "Enable DHCP server on the interface.", + "type": "boolean", + "default": true, + "readOnly": true + } + } + }, + "ltePort": { + "type": "object", + "properties": {} + }, + "mgmtPort": { + "type": "object", + "properties": {} + } + }, + "title": "New Juniper SSR400-W-US branch router", + "description": "Add a new Juniper SSR400-W-US branch router to the configuration.", + "properties": { + "routerName": { + "title": "Router Name", + "description": "Enter a name identifier for the router.", + "type": "string" + }, + "routerDescription": { + "title": "Description", + "description": "Description for the router.", + "type": "string" + }, + "routerLocation": { + "title": "Site Location", + "description": "Enter the address or location of the router. Example: City, State.", + "type": "string" + }, + "ports": { + "type": "object", + "title": "Ports", + "description": "Port and network settings.", + "properties": { + "fte-0-0": { + "title": "LAN - fte-0-0", + "description": "Internal switch port on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-0": { + "title": "WAN - ge-0-0", + "description": "SFP Port 0 labeled on the device", + "$ref": "#/definitions/wanPort" + }, + "ge-0-1": { + "title": "WAN - ge-0-1", + "description": "SFP Port 1 labeled on the device", + "$ref": "#/definitions/wanPort" + }, + "ge-0-2": { + "title": "WAN - ge-0-2", + "description": "Port 2 labeled on the device", + "$ref": "#/definitions/wanPort" + }, + "ge-0-3": { + "title": "LAN - ge-0-3", + "description": "Port 3 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-4": { + "title": "LAN - ge-0-4", + "description": "Port 4 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-5": { + "title": "LAN - ge-0-5", + "description": "Port 5 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-6": { + "title": "LAN - ge-0-6", + "description": "Port 6 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-7": { + "title": "LAN - ge-0-7", + "description": "Port 7 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-8": { + "title": "LAN - ge-0-8", + "description": "Port 8 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-9": { + "title": "LAN - ge-0-9", + "description": "Port 9 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ha-0-0": { + "title": "LAN - ha-0-0", + "description": "HA device interface", + "$ref": "#/definitions/lanPort" + }, + "ap-0-0": { + "title": "LAN - ap-0-0", + "description": "Internal AP port on the device", + "$ref": "#/definitions/lanPort" + }, + "lte-0-0": { + "title": "WAN - lte-0-0", + "description": "LTE device interface", + "$ref": "#/definitions/wanPort" + } + } + } + } + } +} \ No newline at end of file diff --git a/templates/Juniper-SSR400-template.json b/templates/Juniper-SSR400-template.json new file mode 100644 index 0000000..858e426 --- /dev/null +++ b/templates/Juniper-SSR400-template.json @@ -0,0 +1,224 @@ +{ + "name": "Juniper-SSR400-Template", + "description": "Adds a standalone Juniper SSR400 router: Juniper SSR400 - 10 ethernet ports", + "enabled": true, + "persistInput": false, + "builtin": true, + "mode": "advanced", + "help": "# Juniper SSR400 Router\n\nThis adds a basic Juniper SSR400 Session Smart Router to your configuration.\n\n\n\n\n##Generate Config\nSelect the generate config icon at the top of the page, and proceed to configuration. Validate and commit to finish adding the new router to running configuration.\n\n## Port Details\nThis template assumes all WAN interfaces on your device will be connected to a network providing it DHCP address assignment, and with connectivity to your conductor.\n\nIt will configure LAN interfaces providing a DHCP server to connected endpoints. From the LAN, the router local GUI and CLI will be accessible at `192.168.128.1`\n\n", + "body": "{% editgroup %}\n\n{\n \"authority\": {\n \"security\": [\n {\n \"name\": \"internal-encrypt-hmac-disable\",\n \"description\": \"Security policy built by builtin router template\",\n \"encrypt\": \"false\",\n \"adaptiveEncryption\": \"false\",\n \"hmacMode\": \"disabled\"\n }\n ],\n \"router\": [\n {\n \"_value\": {\n \"name\": \"{{routerName}}\",\n \"description\": \"{{routerDescription}}\",\n \"location\": \"{{routerLocation}}\",\n \"interNodeSecurity\": \"internal-encrypt-hmac-disable\",\n \"system\": {\n \"ntp\": {\n \"server\": [\n {\n \"ipAddress\": \"216.239.35.0\"\n },\n {\n \"ipAddress\": \"216.239.35.4\"\n },\n {\n \"ipAddress\": \"216.239.35.8\"\n },\n {\n \"ipAddress\": \"216.239.35.12\"\n }\n ]\n }\n },\n \"dnsConfig\": [\n {\n \"mode\": \"static\",\n \"address\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ],\n \"applicationIdentification\": {\n \"mode\": [\n \"all\"\n ]\n },\n \"node\": [\n {\n \"name\": \"node1\",\n \"role\": \"combo\",\n \"description\": \"{{routerName}} router node\",\n \"deviceInterface\": [\n {\n \"description\": \"SFP Port 0 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-0\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-0 Network Interface\",\n \"description\": \"\",\n \"sourceNat\": \"true\",\n \"dhcp\": \"v4\",\n \"conductor\": \"true\",\n \"management\": \"true\",\n \"defaultRoute\": \"true\",\n \"managementVector\": {\n \"priority\": \"101\",\n \"name\": \"mgmt\"\n }\n }\n ]\n },\n {\n \"description\": \"SFP Port 1 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-1\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-1 Network Interface\",\n \"description\": \"\",\n \"sourceNat\": \"true\",\n \"dhcp\": \"v4\",\n \"conductor\": \"true\",\n \"management\": \"true\",\n \"defaultRoute\": false,\n \"managementVector\": {\n \"priority\": \"102\",\n \"name\": \"mgmt\"\n }\n }\n ]\n },\n {\n \"description\": \"Port 2 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-2\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-2 Network Interface\",\n \"description\": \"\",\n \"sourceNat\": \"true\",\n \"dhcp\": \"v4\",\n \"conductor\": \"true\",\n \"management\": \"true\",\n \"defaultRoute\": false,\n \"managementVector\": {\n \"priority\": \"103\",\n \"name\": \"mgmt\"\n }\n }\n ]\n },\n {\n \"description\": \"Port 3 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-3\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-3 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"Port 4 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-4\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-4 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"Port 5 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-5\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-5 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"Port 6 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-6\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-6 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"Port 7 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-7\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-7 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"Port 8 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-8\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-8 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"Port 9 labeled on the device\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ge-0-9\",\n \"networkInterface\": [\n {\n \"name\": \"ge-0-9 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"description\": \"HA device interface\",\n \"enabled\": \"true\",\n \"forwarding\": \"true\",\n \"name\": \"ha-0-0\",\n \"networkInterface\": [\n {\n \"name\": \"ha-0-0 Network Interface\",\n \"description\": \"\",\n \"address\": [\n {\n \"prefixLength\": \"24\",\n \"ipAddress\": \"192.168.128.1\",\n \"hostService\": [\n {\n \"serviceType\": \"ssh\",\n \"description\": \"SSH management\",\n \"enabled\": \"true\"\n },\n {\n \"serviceType\": \"dhcp-server\",\n \"serverName\": \"{{ routerName }}\",\n \"addressPool\": [\n {\n \"startAddress\": \"192.168.128.100\",\n \"endAddress\": \"192.168.128.200\",\n \"router\": [\n \"192.168.128.1\"\n ],\n \"domainServer\": [\n \"1.1.1.1\",\n \"8.8.8.8\"\n ]\n }\n ]\n },\n {\n \"serviceType\": \"web\",\n \"description\": \"Web GUI Management\",\n \"enabled\": \"true\"\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n },\n \"_operation\": \"create\"\n }\n ]\n }\n}", + "schema": { + "type": "object", + "definitions": { + "wanPort": { + "type": "object", + "properties": { + "conductor": { + "title": "Conductor can be reached from this interface", + "type": "boolean", + "default": true, + "readOnly": true + }, + "dhcpClient": { + "title": "Address learned using DHCP", + "type": "boolean", + "default": true, + "readOnly": true + } + }, + "dependencies": { + "dhcpClient": { + "oneOf": [ + { + "properties": { + "dhcpClient": { + "const": true, + "readOnly": true + } + } + }, + { + "properties": { + "dhcpClient": { + "const": false, + "readOnly": true + }, + "address": { + "title": "IP address", + "type": "string", + "description": "Network interface IP address. Example: 128.128.128.2", + "readOnly": true + }, + "prefix": { + "title": "Prefix", + "type": "string", + "description": "Network prefix length. Example: 24", + "readOnly": true + }, + "gateway": { + "title": "Gateway", + "type": "string", + "description": "Network gateway IP address. Example: 128.128.128.1", + "readOnly": true + } + } + } + ] + }, + "dhcpServer": { + "oneOf": [ + { + "properties": { + "dhcpServer": { + "const": true, + "readOnly": true + }, + "dhcpServerStartAddr": { + "title": "DHCP server pool start address", + "type": "string", + "default": "192.168.128.100", + "readOnly": true + }, + "dhcpServerEndAddr": { + "title": "DHCP server pool end address", + "type": "string", + "default": "192.168.128.254", + "readOnly": true + } + } + }, + { + "properties": { + "dhcpServer": { + "const": false, + "readOnly": true + } + } + } + ] + } + } + }, + "lanPort": { + "type": "object", + "properties": { + "web": { + "title": "Management GUI", + "description": "Enable web access to the node management GUI using HTTPS.", + "type": "boolean", + "default": true, + "readOnly": true + }, + "ssh": { + "title": "Management SSH", + "description": "Enable terminal access to the node management CLI using SSH.", + "type": "boolean", + "default": true, + "readOnly": true + }, + "dhcpServer": { + "title": "DHCP Server", + "description": "Enable DHCP server on the interface.", + "type": "boolean", + "default": true, + "readOnly": true + } + } + }, + "ltePort": { + "type": "object", + "properties": {} + }, + "mgmtPort": { + "type": "object", + "properties": {} + } + }, + "title": "New Juniper SSR400 branch router", + "description": "Add a new Juniper SSR400 branch router to the configuration.", + "properties": { + "routerName": { + "title": "Router Name", + "description": "Enter a name identifier for the router.", + "type": "string" + }, + "routerDescription": { + "title": "Description", + "description": "Description for the router.", + "type": "string" + }, + "routerLocation": { + "title": "Site Location", + "description": "Enter the address or location of the router. Example: City, State.", + "type": "string" + }, + "ports": { + "type": "object", + "title": "Ports", + "description": "Port and network settings.", + "properties": { + "fte-0-0": { + "title": "LAN - fte-0-0", + "description": "Internal switch port on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-0": { + "title": "WAN - ge-0-0", + "description": "SFP Port 0 labeled on the device", + "$ref": "#/definitions/wanPort" + }, + "ge-0-1": { + "title": "WAN - ge-0-1", + "description": "SFP Port 1 labeled on the device", + "$ref": "#/definitions/wanPort" + }, + "ge-0-2": { + "title": "WAN - ge-0-2", + "description": "Port 2 labeled on the device", + "$ref": "#/definitions/wanPort" + }, + "ge-0-3": { + "title": "LAN - ge-0-3", + "description": "Port 3 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-4": { + "title": "LAN - ge-0-4", + "description": "Port 4 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-5": { + "title": "LAN - ge-0-5", + "description": "Port 5 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-6": { + "title": "LAN - ge-0-6", + "description": "Port 6 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-7": { + "title": "LAN - ge-0-7", + "description": "Port 7 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-8": { + "title": "LAN - ge-0-8", + "description": "Port 8 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ge-0-9": { + "title": "LAN - ge-0-9", + "description": "Port 9 labeled on the device", + "$ref": "#/definitions/lanPort" + }, + "ha-0-0": { + "title": "LAN - ha-0-0", + "description": "HA device interface", + "$ref": "#/definitions/lanPort" + } + } + } + } + } +} \ No newline at end of file