atlanticwave-sdx / sdx-controller

Central Controller for AtlanticWave SDX.
https://www.atlanticwave-sdx.net
MIT License
1 stars 3 forks source link

SDX-Controller should display vlan field for a connection/l2vpn instead of vlan_range #314

Open italovalcy opened 1 month ago

italovalcy commented 1 month ago

According to the provisioning API spec, the Endpoint.VLAN should be called "vlan" instead of "vlan_range". For data input, it is already working fine. For displaying it is wrong (vlan_range).

Example:

$ curl -s http://0.0.0.0:8080/SDX-Controller/1.0.0/connection/c8659334-655f-4d6c-9d18-5c0759c62315
{
  "endpoints": [
    {
      "id": "urn:sdx:port:amlight.net:Switch01:16",
      "name": "urn:sdx:port:amlight.net:Switch01:16",
      "vlan_range": 700
    },
    {
      "id": "urn:sdx:port:tenet.ac.za:Switch06:22",
      "name": "urn:sdx:port:tenet.ac.za:Switch06:22",
      "vlan_range": 600
    }
  ],
  "id": "c8659334-655f-4d6c-9d18-5c0759c62315",
  "name": "VLAN between AMPATH/700 and TENET/600"
}

Expected behavior:

$ curl -s http://0.0.0.0:8080/SDX-Controller/1.0.0/connection/c8659334-655f-4d6c-9d18-5c0759c62315
{
  "endpoints": [
    {
      "id": "urn:sdx:port:amlight.net:Switch01:16",
      "name": "urn:sdx:port:amlight.net:Switch01:16",
      "vlan": "700"
    },
    {
      "id": "urn:sdx:port:tenet.ac.za:Switch06:22",
      "name": "urn:sdx:port:tenet.ac.za:Switch06:22",
      "vlan": "600"
    }
  ],
  "id": "c8659334-655f-4d6c-9d18-5c0759c62315",
  "name": "VLAN between AMPATH/700 and TENET/600"
}

In summary, two changes are needed:

jab1982 commented 1 month ago

Fix to support the AtlanticWave-SDX Provisioning specification 1.0.

sajith commented 1 day ago

I have been looking into this. Basically, in getconnection_by_id(), we are simply returning what's in the database, from connections collection:

https://github.com/atlanticwave-sdx/sdx-controller/blob/c906388327fd3e075ddedb0066d487c68b1c9ca2/sdx_controller/controllers/l2vpn_controller.py#L80-L83

What gets inserted in connections though? That seems to be simply the original connection request that place_connection() received.

https://github.com/atlanticwave-sdx/sdx-controller/blob/c906388327fd3e075ddedb0066d487c68b1c9ca2/sdx_controller/controllers/l2vpn_controller.py#L136-L139

@italovalcy, could you please share some more details? What was the connection request, and what are the topologies? And what should be really the behavior of GET /connection/:service_id? I am not sure returning the original request itself is very useful. Perhaps the client wants to know breakdown that SDX produced, and status of the connection request? We do not seem to be keeping a record of the failed connection requests -- shouldn't we keep those also in the database?

sajith commented 1 day ago

Also inviting @congwang09 and @YufengXin to the discussion.