$schema: http://json-schema.org/draft-07/schema#
type: object
definitions:
  ipAddress:
    type: string
    pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}$
  ip6Address:
    type: string
    pattern: ^([0-9a-f]{0,4}:){2,7}[0-9a-f]{0,4}$
  ip46Address:
    oneOf:
    - $ref: '#/definitions/ipAddress'
    - $ref: '#/definitions/ip6Address'
  ipAddressCidr:
    type: string
    pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}$
  ip6AddressCidr:
    type: string
    pattern: ^([0-9a-f]{0,4}:){2,7}[0-9a-f]{0,4}/[0-9]{1,3}$
  ip46AddressCidr:
    oneOf:
    - $ref: '#/definitions/ipAddressCidr'
    - $ref: '#/definitions/ip6AddressCidr'
  interfaceName:
    type: string
    pattern: ^((vrf|mbm|lan|sfp|wfi|br|vxl|xfrm|veth)[0-9]+(\.[0-9]+)?|(lan[0-9]+(\.(rej|acc[0-9]*))))$
  portNumber:
    type: integer
    minimum: 1
    maximum: 65535
  netconfItems:
    type: object
    properties:
      addr:
        type: object
        patternProperties:
          ^((lan|sfp|wfi|br|vxl|lo|vrf|veth|xfrm)[0-9]*(\.[0-9]+)?|(lan[0-9]+(\.(rej|acc[0-9]*))))$:
            type: array
            items:
              $ref: '#/definitions/ip46AddressCidr'
        additionalProperties: false
      can:
        type: object
        patternProperties:
          ^(can)[0-9]*$:
            type: object
            properties:
              bitrate:
                type: integer
              mode:
                type: string
            required:
            - bitrate
            - mode
            additionalProperties: false
        additionalProperties: false
      vrf:
        type: object
        patternProperties:
          ^(vrf)[0-9]*$:
            type: object
            properties:
              table:
                type: integer
                minimum: 10
                maximum: 499
              slaves:
                type: array
                items:
                  $ref: '#/definitions/interfaceName'
              interconnect:
                type: object
                patternProperties:
                  ^ivr[0-9]{1,2}$:
                    type: string
                    pattern: ^ivr[0-9]{1,2}$
                additionalProperties: false

            required:
            - table
            - slaves
            additionalProperties: false
        additionalProperties: false
      route:
        type: array
        items:
          type: object
          properties:
            dst:
              $ref: '#/definitions/ip46AddressCidr'
            via:
              $ref: '#/definitions/ip46Address'
            metric:
              type: integer
              minimum: 0
              maximum: 65535
            table:
              type: integer
          required:
          - dst
          - via
          additionalProperties: false
      dhcp:
        type: object
        properties:
          client:
            type: object
            patternProperties:
              ^(lan|sfp|wfi|br|vxl|veth)[0-9]+(\.[0-9]+)?$:
                type: object
                properties:
                  metric:
                    type: integer
                    minimum: 0
                    maximum: 65535
                  retransmit:
                    type: integer
                    minimum: 100
                    maximum: 5000
                  use-dns:
                    type: boolean
                  class-id:
                    type: string
                  user-class:
                    type: array
                    items:
                      type: string
                additionalProperties: false
            additionalProperties: false
          server:
            type: object
            patternProperties:
              ^((lan|sfp|wfi|br|vxl|veth)[0-9]+(\.[0-9]+)?||(lan[0-9]+(\.(rej|acc[0-9]*))))$:
                type: object
                properties:
                  range:
                    type: array
                    items:
                      $ref: '#/definitions/ipAddress'
                    minItems: 2
                    maxItems: 2
                  prefix:
                    type: integer
                    minimum: 1
                    maximum: 32
                  duration:
                    type: integer
                    minimum: 1
                  router:
                    $ref: '#/definitions/ipAddress'
                  nameserver:
                    type: array
                    items:
                      $ref: '#/definitions/ipAddress'
                    maxItems: 2
                  vendor:
                    type: object
                    patternProperties:
                      ^([0-9]+|0x[0-9A-Fa-f]{1,8})$:
                        type: object
                        patternProperties:
                          ^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]|0x[0-9A-Fa-f]{1,2})$:
                            type: string
                        additionalProperties: false
                    additionalProperties: false
                required:
                - range
                - prefix
                additionalProperties: false
            additionalProperties: false
          relay:
            type: object
            patternProperties:
              ^((lan|sfp|wfi|br|vxl|veth)[0-9]+(\.[0-9]+)?|(lan[0-9]+(\.(rej|acc[0-9]*))))$:
                type: object
                properties:
                  servers:
                    type: array
                    items:
                      $ref: '#/definitions/ipAddress'
                  interfaces:
                    type: array
                    items:
                      $ref: '#/definitions/interfaceName'
                additionalProperties: false
            additionalProperties: false
        additionalProperties: false
      dhcpv6:
        type: object
        properties:
          relay:
            type: object
            patternProperties:
              ^((lan|sfp|wfi|br|vxl|veth)[0-9]+(\.[0-9]+)?|(lan[0-9]+(\.(rej|acc[0-9]*))))$:
                type: object
                properties:
                  servers:
                    type: array
                    items:
                      $ref: '#/definitions/ip6Address'
                additionalProperties: false
            additionalProperties: false
        additionalProperties: false
      vlan:
        type: object
        patternProperties:
          ^(lan|sfp|br)[0-9]+(\.[0-9]+)$:
            type: object
            properties:
              vlanid:
                type: integer
                minimum: 1
                maximum: 4094
              parent:
                type: string
                pattern: ^(lan|sfp|br)[0-9]+$
            required:
            - vlanid
            - parent
            additionalProperties: false
        additionalProperties: false
      vxlan:
        type: object
        patternProperties:
          ^(vxl)[0-9]+$:
            type: object
            properties:
              vxlanid:
                type: integer
                minimum: 0
                maximum: 16777215
              group:
                $ref: '#/definitions/ipAddress'
              parent:
                $ref: '#/definitions/interfaceName'
            required:
            - vxlanid
            - group
            - parent
            additionalProperties: false
        additionalProperties: false
      bridge:
        type: object
        patternProperties:
          ^(br)[0-9]+$:
            type: object
            properties:
              slaves:
                type: array
                items:
                  type: string
                  pattern: ^((lan|br|sfp|wfi|vxl|veth)[0-9]+(\.[0-9]+)?|(lan[0-9]+(\.(rej|acc[0-9]*))))$
              isolate:
                type: boolean
            required:
            - slaves
            additionalProperties: false
        additionalProperties: false
      wifi:
        type: object
        properties:
          client:
            type: object
            patternProperties:
              ^(wfi)[0-9](\.[0-9]+)?$:
                type: object
                properties:
                  parent:
                    type: string
                    pattern: ^(wfi)[0-9]$
                  networks:
                    type: array
                    items:
                      type: object
                      properties:
                        ssid:
                          type: string
                          minLength: 1
                          maxLength: 31
                        hidden:
                          type: boolean
                        fast:
                          type: boolean
                        psk:
                          type: string
                          minLength: 8
                        username:
                          type: string
                        password:
                          type: string
                        ca:
                          type: string
                        aaa:
                          type: array
                          items:
                            type: string
                        learn:
                          type: boolean
                        roaming:
                          type: integer
                          maximum: -10
                          minimum: -110
                        interval:
                          type: integer
                          maximum: 300
                          minimum: 1
                      required:
                      - ssid
                      additionalProperties: false
                additionalProperties: false
            additionalProperties: false
          ap:
            type: object
            patternProperties:
              ^(wfi)[0-9](\.[0-9]+)?$:
                type: object
                properties:
                  parent:
                    type: string
                    pattern: ^(wfi)[0-9]$
                  mac:
                    type: string
                    minLength: 12
                    maxLength: 12
                  ssid:
                    type: string
                    minLength: 1
                    maxLength: 31
                  hidden:
                    type: boolean
                  channel:
                    type: integer
                    enum: [
                      0, 1, 3, 5, 6, 9, 11, 12, 13,
                      33, 36, 38, 40, 44, 46, 48, 52, 54, 56, 60, 62, 64,
                      100, 102, 104, 108, 110, 112, 116, 118, 120,
                      124, 126, 128, 132, 134, 136, 140, 142, 144,
                      149, 151, 153, 157, 159, 161, 165
                    ]
                  power:
                    type: integer
                    minimum: 1
                    maximum: 20
                  psk:
                    type: string
                    minLength: 8
                  radius:
                    type: object
                    properties:
                      nasid:
                        type: string
                      client-addr:
                        $ref: '#/definitions/ipAddress'
                      client-dev:
                        type: string
                      servers:
                        type: array
                        items:
                          type: object
                          properties:
                            server:
                              $ref: '#/definitions/ipAddress'
                            secret:
                              type: string
                          required:
                          - server
                          - secret
                          additionalProperties: false
                    additionalProperties: false
                  cc:
                    type: string
                    minLength: 2
                    maxLength: 2
                  isolate:
                    type: boolean
                required:
                - ssid
                - channel
                additionalProperties: false
            additionalProperties: false
          mesh:
            type: object
            patternProperties:
              ^(wfi)[0-9](\.[0-9]+)?$:
                type: object
                properties:
                  parent:
                    type: string
                    pattern: ^(wfi)[0-9]$
                  mac:
                    type: string
                    minLength: 12
                    maxLength: 12
                  ssid:
                    type: string
                    minLength: 1
                    maxLength: 31
                  channel:
                    type: integer
                    enum: [
                      1, 5, 6, 9, 11, 13,
                      36, 40, 44, 48, 52, 56, 60, 64,
                      100, 104, 108, 112, 116, 120, 124, 128, 132,
                      136, 140, 144, 149, 153, 157, 161, 165
                    ]
                  power:
                    type: integer
                    minimum: 1
                    maximum: 20
                  psk:
                    type: string
                    minLength: 8
                required:
                - ssid
                - channel
                additionalProperties: false
          mon:
            type: object
            patternProperties:
              ^(wfi)[0-9](\.[0-9]+)?$:
                type: object
                properties:
                  parent:
                    type: string
                    pattern: ^(wfi)[0-9]$
                  filter:
                    type: string
                    enum: [
                      "probe-req"
                    ]
                required:
                - filter
                additionalProperties: false
        additionalProperties: false
      modem:
        type: object
        properties:
          roaming:
            type: object
            properties:
              default:
                type: boolean
            patternProperties:
              ^(allow|deny)$:
                type: object
                patternProperties:
                  ^(mbm[0-9]|[0-9]+)$:
                    type: array
                    items:
                      type: integer
                      minimum: 1
                      maximum: 999
                additionalProperties: false
          slots:
            type: object
            patternProperties:
              ^(mbm)[0-9]$:
                type: array
                items:
                  type: integer
                  minimum: 1
                  maximum: 4
            additionalProperties: false
          apn:
            type: object
            patternProperties:
              ^(mbm[0-9]|[0-9]{5})$:
                type: object
                properties:
                  apn:
                    type: string
                  username:
                    type: string
                  password:
                    type: string
                  auth:
                    enum:
                    - pap
                    - chap
                  routes:
                    type: array
                    items:
                      $ref: '#/definitions/ipAddressCidr'
                required:
                - apn
                additionalProperties: false
            additionalProperties: false
          net:
            type: object
            patternProperties:
              ^mbm[0-9]+$:
                type: object
                properties:
                  use-dns:
                    type: boolean
            additionalProperties: false
        additionalProperties: false
      vpn:
        type: object
        properties:
          tunnels:
            type: object
            patternProperties:
              ^.*$:
                type: object
                patternProperties:
                  ^(local|remote)-ts:
                    type: array
                    items:
                      $ref: '#/definitions/ip46AddressCidr'
                properties:
                  gateway:
                    type: string
                  probe:
                    oneOf:
                    - $ref: '#/definitions/ip46Address'
                    - enum: [ "" ]
                  ca:
                    type: string
                  identity:
                    type: string
                  xfrmi:
                    type: string
                    pattern: ^xfrm[0-9]+$
                  uplinks:
                    type: object
                    patternProperties:
                      ^(lan|sfp|wfi|mbm|br|vxl|veth)[0-9]+(\.[0-9]+)?$:
                        type: object
                        properties:
                          quality:
                            type: integer
                            minimum: 1
                            maximum: 65534
                          prio:
                            type: integer
                            minimum: 1
                            maximum: 65534
                        additionalProperties: false
                    minProperties: 1
                    additionalProperties: false
                required:
                - gateway
                - identity
                - xfrmi
                - uplinks
                additionalProperties: false
            additionalProperties: false
          latencies:
            type: object
            patternProperties:
              ^(lan|sfp|wfi|mbm|br|vxl|veth)[0-9]+(\.[0-9]+)?$:
                type: object
                properties:
                  target:
                    type: integer
                    minimum: 1
                additionalProperties: false
          qos:
            type: object
            patternProperties:
              ^.*$:
                type: object
                properties:
                  selectors:
                    type: array
                    items:
                      type: object
                      patternProperties:
                        ^(src|dst)$:
                          $ref: '#/definitions/ipAddressCidr'
                        ^(tcp|udp)$:
                          type: object
                          properties:
                            dst-port:
                              $ref: '#/definitions/portNumber'
                          required:
                          - dst-port
                          additionalProperties: false
                      additionalProperties: false
                  absolute:
                    type: integer
                  relative:
                    type: integer
                required:
                - selectors
                additionalProperties: false
            additionalProperties: false
          bypass:
            type: object
            properties:
              subnet:
                type: object
                patternProperties:
                  ^.*$:
                    type: array
                    items:
                      $ref: '#/definitions/ip46AddressCidr'
                additionalProperties: false
              interface:
                patternProperties:
                  ^.*$:
                    type: array
                    items:
                      $ref: '#/definitions/interfaceName'
            additionalProperties: false
          clusters:
            type: object
            patternProperties:
              ^.*$:
                type: object
                properties:
                  ifname:
                    $ref: '#/definitions/interfaceName'
                  sync-ifname:
                    $ref: '#/definitions/interfaceName'
                  clusterip:
                    $ref: '#/definitions/ipAddress'
                  secret:
                    type: string
                  mac-count:
                    type: integer
                    enum: [
                      2, 4, 8, 16, 32, 64, 128
                    ]
                  rebalance:
                    type: boolean
                  tunnels:
                    type: array
                    items:
                      type: string
                required:
                - ifname
                - secret
                - tunnels
                additionalProperties: false
            additionalProperties: false
        additionalProperties: false
      firewall:
        type: object
        properties:
          forward:
            type: array
            items:
              type: object
              properties:
                iif:
                  type: string
                oif:
                  type: string
              patternProperties:
                ^(src|dst)$:
                  $ref: '#/definitions/ip46AddressCidr'
                ^(tcp|udp|icmp|icmp6)$:
                  type: object
                  patternProperties:
                    ^(src|dst|type|code)$:
                      $ref: '#/definitions/portNumber'
                  additionalProperties: false
              additionalProperties: false
          dnat:
            type: array
            items:
              type: object
              properties:
                iif:
                  type: string
              patternProperties:
                ^(src|dst|to)$:
                  $ref: '#/definitions/ipAddressCidr'
                ^(tcp|udp)$:
                  type: object
                  patternProperties:
                    ^(src|dst|to)$:
                      $ref: '#/definitions/portNumber'
                  additionalProperties: false
              required:
              - to
              additionalProperties: false
          snat:
            type: array
            items:
              type: object
              properties:
                oif:
                  type: string
              patternProperties:
                ^(src|dst|to)$:
                  $ref: '#/definitions/ipAddressCidr'
                ^(tcp|udp)$:
                  type: object
                  patternProperties:
                    ^(src|dst|to)$:
                      $ref: '#/definitions/portNumber'
                  additionalProperties: false
              required:
              - to
              additionalProperties: false
          input:
            type: array
            items:
              type: object
              properties:
                iif:
                  type: string
              patternProperties:
                ^(tcp|udp)$:
                  type: object
                  properties:
                    dst:
                      $ref: '#/definitions/portNumber'
                  additionalProperties: false
                  required:
                  - dst
              additionalProperties: false
          masq:
            type: array
            items:
              type: object
              properties:
                oif:
                  type: string
              required:
              - oif
              additionalProperties: false
          netmap:
            type: array
            items:
              type: object
              properties:
                iif: # deprecated in favour of ifname
                  type: string
                ifname:
                  $ref: '#/definitions/interfaceName'
              patternProperties:
                ^(from|to|match)$:
                  $ref: '#/definitions/ipAddressCidr'
              required:
              - from
              - to
              additionalProperties: false
        additionalProperties: false
      voltage:
        type: object
        properties:
          settings:
            type: object
            properties:
              follow-up:
                type: integer
                minimum: 0
            additionalProperties: false
        additionalProperties: false
      api:
        type: array
        items:
          type: object
          properties:
            port:
              $ref: '#/definitions/portNumber'
            ifname:
              $ref: '#/definitions/interfaceName'
            handler:
              type: object
              patternProperties:
                ^(gnss|led|modem|time|imu|system)$:
                  type: object
                  properties: {}
                  additionalProperties: false
              additionalProperties: false
          required:
          - port
          - handler
          additionalProperties: false
      http:
        type: array
        items:
          type: object
          properties:
            location:
              type: string
              pattern: ^(USB|SSD|BUNDLE):[a-zA-Z0-9\-\._~]+$
            type:
              type: string
              pattern: ^(removable|bundle)$
            ifname:
              $ref: '#/definitions/interfaceName'
            port:
              $ref: '#/definitions/portNumber'
          required:
          - location
          - type
          - port
          additionalProperties: false
      ntp:
        type: array
        items:
          type: object
          properties:
            ifname:
              $ref: '#/definitions/interfaceName'
          required:
          - ifname
          additionalProperties: false
      container:
        type: object
        patternProperties:
          ^[a-zA-Z0-9\-\._~:]+$:
            type: object
            properties:
              location:
                type: string
                pattern: ^(USB|SSD|BUNDLE)(:[a-zA-Z0-9\-\._~]+)?$
              image:
                type: string
                pattern: ^[a-zA-Z0-9\-\._~:]+$
              mem:
                type: integer
              veth:
                type: object
                patternProperties:
                  ^veth[0-9]+$:
                    type: string
                    pattern: ^[a-z0-9\.]+$
                additionalProperties: false
              physif:
                type: array
                items:
                  type: string
                  pattern: ^(lan|sfp|can)[0-9]+$
              env:
                type: array
                items:
                  type: string
                  pattern: ^[a-zA-Z0-9\.\-_~:]+=.*$
              nodes:
                type: array
                items:
                  type: string
                  pattern: ^[a-zA-Z0-9\-\._~:]+$
            required:
            - location
            - image
            - mem
            additionalProperties: false
        additionalProperties: false
      gnss:
        type: array
        items:
          type: object
          properties:
            port:
              $ref: '#/definitions/portNumber'
            ifname:
              $ref: '#/definitions/interfaceName'
          required:
          - port
          additionalProperties: false
      itxpt:
        type: object
        patternProperties:
          ^((lan|sfp|wfi|br|vxl|veth)[0-9](\.[0-9]+)?|(lan[0-9]+(\.(rej|acc[0-9]*))))$:
            type: object
            properties:
              services:
                type: object
                properties:
                  inventory: {}
                required:
                - inventory # mandatory in the ITxPT standard
            required:
            - services
        minProperties: 1
        additionalProperties: false
      users:
        type: object
        properties:
          local:
            type: object
            patternProperties:
              ^[a-zA-Z0-9]+$:
                type: object
                properties:
                  password:
                    type: string
                required:
                - password
                additionalProperties: false
            additionalProperties: false
        additionalProperties: false
      snmp:
        type: object
        properties:
          agent:
            type: object
            patternProperties:
              ^((lan|sfp|wfi|br|vxl|lo|vrf|veth|xfrm)[0-9]*(\.[0-9]+)?|(lan[0-9]+(\.(rej|acc[0-9]*))))$:
                type: object
                properties:
                  hostname:
                    type: string
                    pattern: ^[a-zA-Z0-9\-\.:]+$
                  users:
                    type: array
                    items:
                      type: object
                      properties:
                        user:
                          type: string
                        password:
                          type: string
                          minLength: 8
                      required:
                      - user
                      additionalProperties: false
                additionalProperties: false
            additionalProperties: false
        additionalProperties: false
      radv:
        type: object
        patternProperties:
          ^((lan|sfp|wfi|br|vxl|veth)[0-9]+(\.[0-9]+)?|(lan[0-9]+(\.(rej|acc[0-9]*))))$:
            type: object
            properties:
              router:
                type: boolean
              prefixes:
                type: object
                patternProperties:
                  ^([0-9a-f]{0,4}:){2,7}[0-9a-f]{0,4}/[0-9]{1,3}$:
                    type: object
                    properties:
                      slaac:
                        type: boolean
                    additionalProperties: false
                additionalProperties: false
              nameservers:
                type: array
                items:
                - $ref: '#/definitions/ip6Address'
            additionalProperties: false
        additionalProperties: false
      imu:
        type: object
        properties:
          orientation:
            type: object
            patternProperties:
              ^(x|y|z)$:
                type: integer
                minimum: -180
                maximum: 180
            additionalProperties: false
        required:
        - orientation
        additionalProperties: false
      logging:
        type: object
        patternProperties:
          ^[a-zA-Z0-9\-\._~:]+$:
            type: object
            properties:
              output:
                type: object
                properties:
                  file:
                    type: object
                    properties:
                      path:
                        type: string
                      size:
                        type: integer
                        minimum: 0
                      keep:
                        type: integer
                        minimum: 0
                    additionalProperties: false
                    required:
                    - path
                  rsyslog:
                    type: object
                    properties:
                      server:
                        type: string
                      port:
                        $ref: '#/definitions/portNumber'
                      hostname:
                        type: string
                      ifname:
                        $ref: '#/definitions/interfaceName'
                    additionalProperties: false
                    required:
                    - server
                minProperties: 1
                additionalProperties: false
              levels:
                type: object
                patternProperties:
                  ^[a-zA-Z0-9\-\._~:]+$:
                    type: integer
                    minimum: 0
                    maximum: 7
                minProperties: 1
                additionalProperties: false
            additionalProperties: false
            required:
            - output
            - levels
        additionalProperties: false
      network-tests:
        type: object
        patternProperties:
          ^[a-zA-Z0-9\-\._~:]+$:
            properties:
              scheme:
                type: string
                pattern: ^(burst|call|fetch|flood|icmp|liveness|ping|stream)$
              connect:
                $ref: '#definitions/ip46Address'
              options:
                type: object
                properties:
                  interval:
                    type: integer
                  up-rate:
                    type: integer
                  down-rate:
                    type: integer
                  pkt-size:
                    type: integer
                  count:
                    type: integer
                  buf-size:
                    type: integer
                  file-size:
                    type: integer
                  ifname:
                    $ref: '#/definitions/interfaceName'
                additionalProperties: false
            required:
            - scheme
            additionalProperties: false
        additionalProperties: false
      lldp:
        type: object
        patternProperties:
          ^[a-zA-Z0-9\-\._~:]+$:
            properties:
              interfaces:
                type: array
                items:
                  type: string
                  pattern: ^((lan|sfp|wfi|br|vxl|veth)[0-9]*(\.[0-9]+)?|(lan[0-9]+(\.(rej|acc[0-9]*))))$
              snmp:
                type: string
                pattern: ^((lan|sfp|wfi|br|vxl|lo|vrf|veth|xfrm)[0-9]*(\.[0-9]+)?|(lan[0-9]+(\.(rej|acc[0-9]*))))$
              hostname:
                type: string
                pattern: ^[a-zA-Z0-9\-\.:]+$
            additionalProperties: false
        additionalProperties: false
      nac:
        type: object
        patternProperties:
          ^[a-zA-Z0-9\-\._~:]+$:
            properties:
              method:
                type: string
                enum: [ "mab", "eap" ]
              ports:
                type: array
                items:
                  type: string
                  pattern: ^((lan|sfp)[0-9]+)$
                minItems: 1
                maxItems: 8
              policy-map:
                type: object
                patternProperties:
                  ^(reject|accept|vlanid:[0-9]+)$:
                    type: string
                    pattern: ^(rej|acc[0-9]*)$
                minProperties: 1
                maxProperties: 16
                additionalProperties: false
              radius:
                type: object
                properties:
                  nasid:
                    type: string
                  client-addr:
                    $ref: '#/definitions/ipAddress'
                  client-dev:
                    type: string
                  servers:
                    type: array
                    items:
                      type: object
                      properties:
                        server:
                          $ref: '#/definitions/ipAddress'
                        secret:
                          type: string
                      required:
                      - server
                      - secret
                      additionalProperties: false
                    minItems: 1
                    maxItems: 4
                required:
                - servers
                additionalProperties: false
            required:
            - ports
            - policy-map
            - radius
            additionalProperties: false
        additionalProperties: false
      link:
        type: object
        patternProperties:
          ^(lan|sfp)[0-9]*$:
            type: object
            properties:
              up:
                type: boolean
              modes:
                type: array
                items:
                  type: object
                  properties:
                    speed:
                      type: integer
                      enum: [ 10, 100, 1000, 10000 ]
                    half-duplex:
                      type: boolean
                  required:
                  - speed
                  additionalProperties: false
            additionalProperties: false
        additionalProperties: false
    additionalProperties: false
  conditionItem:
    type: object
    properties:
      vpn:
        type: object
        properties:
          tunnel:
            type: string
        required:
        - tunnel
        additionalProperties: false
    additionalProperties: false
    minProperties: 1
    maxProperties: 1
properties:
  unconditional:
    $ref: '#/definitions/netconfItems'
  conditional:
    type: array
    items:
      type: object
      properties:
        if:
          $ref: '#/definitions/conditionItem'
        then:
          $ref: '#/definitions/netconfItems'
        else:
          $ref: '#/definitions/netconfItems'
      required:
      - if
      additionalProperties: false
required:
- unconditional
additionalProperties: false

