openapi: 3.2.0
info:
  title: 'Forward: Intranet Nodes API'
  summary: Model private inter-site networks that the network connects to
  description: |-
    Unlike the internet node, an intranet node routes both public and private addresses, and it reaches only the subnets
    on its connections. It is one kind of
    [synthetic device](https://docs.fwd.app/latest/application/sources/configure-collection/synthetic-devices/),
    typically standing in for a leased L3 service or an L3 hub-and-spoke with the node as the hub. For the modeling
    details, see
    [Intranet node](https://docs.fwd.app/latest/application/sources/configure-collection/synthetic-devices/reference/#intranet-node).

    Changes to a network’s intranet nodes affect future Snapshots.
  contact:
    email: support@forwardnetworks.com
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  version: 26.8
servers:
  - url: /api
security:
  - api_token: []
tags:
  - name: Collection Sources
    description: Specify the devices, endpoints, and other sources to collect from
  - name: Synthetic Devices
    description: Model a network’s internet connections, intranets, L2VPNs, L3VPNs, WAN circuits, and encryptors
    parent: Collection Sources
  - name: Intranet Nodes
    description: Model private inter-site networks that the network connects to
    parent: Synthetic Devices
paths:
  /networks/{networkId}/intranet-nodes:
    get:
      tags:
        - Intranet Nodes
      summary: Get a network’s intranet nodes
      operationId: getIntranetNodes
      parameters:
        - name: networkId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntranetNodeList'
    put:
      tags:
        - Intranet Nodes
      summary: Replace all of a network’s intranet nodes
      operationId: putIntranetNodes
      parameters:
        - name: networkId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IntranetNodeList'
        required: true
      responses:
        '204':
          description: No Content
          content: {}
  /networks/{networkId}/intranet-nodes/{nodeName}:
    get:
      tags:
        - Intranet Nodes
      summary: Get an intranet node
      operationId: getIntranetNode
      parameters:
        - name: networkId
          in: path
          required: true
          schema:
            type: string
        - name: nodeName
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntranetNode'
    put:
      tags:
        - Intranet Nodes
      summary: Add or replace an intranet node
      operationId: putIntranetNode
      parameters:
        - name: networkId
          in: path
          required: true
          schema:
            type: string
        - name: nodeName
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IntranetNode'
        required: true
      responses:
        '204':
          description: No Content
          content: {}
    patch:
      tags:
        - Intranet Nodes
      summary: Update an intranet node
      description: |-
        All JSON properties in the request body are optional. Include only the properties you wish to
        change.
      operationId: patchIntranetNode
      parameters:
        - name: networkId
          in: path
          required: true
          schema:
            type: string
        - name: nodeName
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IntranetNodePatch'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntranetNode'
    delete:
      tags:
        - Intranet Nodes
      summary: Remove an intranet node
      operationId: deleteIntranetNode
      parameters:
        - name: networkId
          in: path
          required: true
          schema:
            type: string
        - name: nodeName
          in: path
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content
          content: {}
  /networks/{networkId}/intranet-nodes/{nodeName}/connections:
    get:
      tags:
        - Intranet Nodes
      summary: Get an intranet node’s connections
      operationId: getIntranetNodeConnections
      parameters:
        - name: networkId
          in: path
          required: true
          schema:
            type: string
        - name: nodeName
          in: path
          required: true
          schema:
            type: string
        - name: uplinkDevice
          in: query
          schema:
            type: string
        - name: uplinkPort
          in: query
          schema:
            type: string
        - name: gatewayDevice
          in: query
          schema:
            type: string
        - name: gatewayPort
          in: query
          schema:
            type: string
        - name: vlan
          in: query
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/L3SyntheticWanConnections'
    post:
      tags:
        - Intranet Nodes
      summary: Add a connection to an intranet node
      operationId: addIntranetNodeConnection
      parameters:
        - name: networkId
          in: path
          required: true
          schema:
            type: string
        - name: nodeName
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/L3SyntheticWanConnection'
        required: true
      responses:
        '204':
          description: No Content
          content: {}
    delete:
      tags:
        - Intranet Nodes
      summary: Remove an intranet node’s connections
      operationId: deleteIntranetNodeConnections
      parameters:
        - name: networkId
          in: path
          required: true
          schema:
            type: string
        - name: nodeName
          in: path
          required: true
          schema:
            type: string
        - name: uplinkDevice
          in: query
          schema:
            type: string
        - name: uplinkPort
          in: query
          schema:
            type: string
        - name: gatewayDevice
          in: query
          schema:
            type: string
        - name: gatewayPort
          in: query
          schema:
            type: string
        - name: vlan
          in: query
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/L3SyntheticWanConnections'
components:
  schemas:
    IntranetNode:
      type: object
      required:
        - name
        - connections
      properties:
        name:
          type: string
          examples:
            - inet
        connections:
          type: array
          items:
            $ref: '#/components/schemas/L3SyntheticWanConnection'
    IntranetNodeList:
      type: object
      required:
        - intranetNodes
      properties:
        intranetNodes:
          type: array
          items:
            $ref: '#/components/schemas/IntranetNode'
    IntranetNodePatch:
      type: object
      properties:
        connections:
          type: array
          items:
            $ref: '#/components/schemas/L3SyntheticWanConnection'
          description: If specified, this list will **replace** all existing connections on the intranet node.
        name:
          type: string
    L3SyntheticWanConnection:
      type: object
      required:
        - uplinkPort
      properties:
        uplinkPort:
          $ref: '#/components/schemas/DevicePort'
          description: The physical uplink port on the edge device.
          examples:
            - device: nyc-rtr-01
              port: eth1/1
        gatewayPort:
          $ref: '#/components/schemas/DevicePort'
          description: The virtual gateway port, if different than `uplinkPort`.
          examples:
            - device: nyc-rtr-01
              port: vlan100
        vlan:
          type: integer
          format: int32
          description: The VLAN of traffic from `uplinkPort`, if tagged.
          examples:
            - 100
        name:
          type: string
          description: |-
            An optional name for this connection, which will be used as the interface name created on the synthetic
            device that links to the physical edge port.
        vrf:
          type: string
          description: An optional name for the VRF on the synthetic device under which this connection resides.
        site:
          type: string
          description: |-
            An optional name for the site in which this connection's gateway device resides. A site is a collection of
            devices that redistribute routes learned from the synthetic device to each other. Grouping connections
            together into a single site enables more accurate site subnet autodiscovery when using `IP_ROUTES` or
            `BGP_ROUTES`.
        subnets:
          type: array
          items:
            type: string
          description: |-
            Advertised subnets. Routes for these subnets are created on the synthetic device if received by another CE.
            Required (and must not be empty) if `subnetAutoDiscovery` is `NONE`.
          examples:
            - - 123.223.47.0/24
        subnetAutoDiscovery:
          $ref: '#/components/schemas/AutoDiscoverySource'
          description: |-
            The types of routes from which advertised subnets are automatically inferred in the gateway device’s routing
            table. Defaults to `NONE`. If `INTERFACE_ADDRESSES`, the gateway port’s IP address is used. If `IP_ROUTES`,
            subnets are inferred from the gateway device’s RIB. If `BGP_ROUTES`, subnets are inferred from the gateway
            device’s Adj-RIB-Out.

            Note: If not `NONE`, routes are created on the synthetic device for both autodiscovered subnets, as well any
            subnets specified in `subnets`, that are received by another CE.

            Note: Using `BGP_ROUTES` will automatically enable collection of Adj-RIB-Out from the gateway device in
            future network collections.
          examples:
            - NONE
        peerIps:
          type: array
          items:
            type: string
          description: |-
            IP addresses of BGP peers to which this connection’s site subnets are advertised. If empty, routes
            advertised to all BGP peers are examined.

            Note: This set is only used if `subnetAutoDiscovery` is `BGP_ROUTES`.
          examples:
            - - 1.1.1.1
        backdoorLinkPorts:
          type: array
          items:
            $ref: '#/components/schemas/DevicePort'
          description: L3 interfaces that provide backdoor connectivity between sites.
        advertisesDefaultRoute:
          type: boolean
          description: |-
            Whether the CE advertises the default route. Defaults to `false`.

            Note: This property is only used if `subnetAutoDiscovery` is `IP_ROUTES`, which should be the case when BGP
            collection is not enabled on the CE. If the Adj-RIB-Out is not collected, the RIB is examined and a default
            route forwarded out `gatewayPort` is skipped if this property is false.
    L3SyntheticWanConnections:
      type: object
      required:
        - connections
      properties:
        connections:
          type: array
          items:
            $ref: '#/components/schemas/L3SyntheticWanConnection'
    DevicePort:
      type: object
      properties:
        device:
          type: string
        port:
          type: string
    AutoDiscoverySource:
      type: string
      enum:
        - NONE
        - IP_ROUTES
        - BGP_ROUTES
        - INTERFACE_ADDRESSES
  securitySchemes:
    api_token:
      type: http
      scheme: basic
