Uploaded image for project: 'ONOS'
  1. ONOS
  2. ONOS-4114

Swagger documentation for Flow POST REST API is incorrect.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 1.5.0
    • Component/s: None
    • Labels:
      None
    • Story Points:
      3
    • Epic Link:
    • Sprint:
      Falcon Sprint 4 (2/29-3/4)

      Description

      The documentation for the JSON to add a selector in the flow API looks like this:

      "selector": {
          "criteria": [
            {
              "type": "ETH_TYPE",
              "ethType": "0x88cc",
              "mac": "00:00:11:00:00:01",
              "port": 1,
              "metadata": "0xabcdL",
              "vlanId": "0x1000",
              "priority": 1,
              "protocol": 1,
              "ip": "10.1.1.0/24",
              "tcpPort": 1,
              "udpPort": 1,
              "sctpPort": 1,
              "icmpType": 1,
              "icmpCode": 1,
              "flowLabel": "0xffffe",
              "icmpv6Type": 1,
              "icmpv6Code": 1,
              "targetAddress": "10.1.1.0/24",
              "label": 1,
              "exthdrFlags": 1,
              "lambda": 1,
              "gridType": "DWDM",
              "channelSpacing": 100,
              "spacingMultiplier": 4,
              "slotGranularity": 8,
              "ochSignalId": 1,
              "tunnelId": 5,
              "ochSignalType": 1,
              "oduSignalId": 1,
              "tributaryPortNumber": 11,
              "tributarySlotLen": 80,
              "tributarySlotBitmap": [
                1
              ],
              "oduSignalType": 4
            }
          ]
        }
      

      But a selector is actually a collection of criterion, so adding a selector with multiple criterion should look more like this:

      "selector": {
          "criteria": [
            {
              "type": "ETH_TYPE",
              "ethType": "0x88cc",
            },
            {
              "type": "ETH_DST",
              "mac": "00:00:11:00:00:01",
            },
            {
              "type": "IN_PORT",
              "port": 1
             }
          ]
        }
      

      I tried to play around with the swagger to get it to display example JSON like this, but it seems tricky to show a list of hetrogenous element (as opposed to one example element when the list is homogenous) with Swagger.
      Can someone with more expertise here take a look?

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            andrea Andrea Campanella
            Reporter:
            jono Jonathan Hart
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: