openapi: 3.2.0
info:
  title: 'Forward: WAN Circuits API'
  summary: Model the point-to-point layer 2 links a provider carries between two sites
  description: |-
    A WAN circuit is a bridge that allows a different VLAN on each side, and one kind of
    [synthetic device](https://docs.fwd.app/latest/application/sources/configure-collection/synthetic-devices/).
    It has exactly two connections, one per end, which you define together rather than adding one at a time. For the
    modeling details, see
    [WAN Circuit](https://docs.fwd.app/latest/application/sources/configure-collection/synthetic-devices/reference/#wan-circuit).

    Changes to a network’s WAN circuits 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: WAN Circuits
    description: Model the point-to-point layer 2 links a provider carries between two sites
    parent: Synthetic Devices
paths:
  /networks/{networkId}/wan-circuits:
    get:
      tags:
        - WAN Circuits
      summary: Get a network’s WAN circuits
      operationId: getWanCircuits
      parameters:
        - name: networkId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WanCircuitList'
    put:
      tags:
        - WAN Circuits
      summary: Replace all of a network’s WAN circuits
      operationId: putWanCircuits
      parameters:
        - name: networkId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WanCircuitList'
        required: true
      responses:
        '204':
          description: No Content
          content: {}
  /networks/{networkId}/wan-circuits/{wanCircuitName}:
    get:
      tags:
        - WAN Circuits
      summary: Get a WAN circuit
      operationId: getWanCircuit
      parameters:
        - name: networkId
          in: path
          required: true
          schema:
            type: string
        - name: wanCircuitName
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WanCircuit'
    put:
      tags:
        - WAN Circuits
      summary: Add or replace a WAN circuit
      operationId: putWanCircuit
      parameters:
        - name: networkId
          in: path
          required: true
          schema:
            type: string
        - name: wanCircuitName
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WanCircuit'
        required: true
      responses:
        '204':
          description: No Content
          content: {}
    patch:
      tags:
        - WAN Circuits
      summary: Update a WAN circuit
      description: |-
        All JSON properties in the request body are optional. Include only the properties you wish to
        change.
      operationId: patchWanCircuit
      parameters:
        - name: networkId
          in: path
          required: true
          schema:
            type: string
        - name: wanCircuitName
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WanCircuitPatch'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WanCircuit'
    delete:
      tags:
        - WAN Circuits
      summary: Remove a WAN circuit
      operationId: deleteWanCircuit
      parameters:
        - name: networkId
          in: path
          required: true
          schema:
            type: string
        - name: wanCircuitName
          in: path
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content
          content: {}
components:
  schemas:
    WanCircuit:
      type: object
      required:
        - name
        - connection1
        - connection2
      properties:
        name:
          type: string
          examples:
            - wan-circuit-01
        connection1:
          $ref: '#/components/schemas/WanCircuitConnection'
        connection2:
          $ref: '#/components/schemas/WanCircuitConnection'
    WanCircuitList:
      type: object
      properties:
        wanCircuits:
          type: array
          items:
            $ref: '#/components/schemas/WanCircuit'
    WanCircuitPatch:
      type: object
      properties:
        name:
          type: string
          examples:
            - wan-circuit-01
        connection1:
          $ref: '#/components/schemas/WanCircuitConnection'
        connection2:
          $ref: '#/components/schemas/WanCircuitConnection'
    WanCircuitConnection:
      type: object
      required:
        - device
        - port
      properties:
        device:
          type: string
          description: A customer edge device name
        port:
          type: string
          description: The name of the connected port on `device`
        vlan:
          type: integer
          format: int32
          description: The VLAN of traffic from `port`, 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 edge device.
  securitySchemes:
    api_token:
      type: http
      scheme: basic
