atlanticwave-sdx / sdx-controller

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

weird data when getting One L2VPN #337

Open italovalcy opened 4 days ago

italovalcy commented 4 days ago

Hi,

If we create one L2VPN and get its data, the returned information is very weird:

# curl -s -X POST -H 'Content-type: application/json' http://sdx-controller:8080/SDX-Controller/l2vpn/1.0 -d '{"name": "VLAN between AMPATH/302 and SAX/302", "endpoints": [{"port_id": "urn:sdx:port:ampath.net:Ampath3:50", "vlan": "302"}, {"port_id": "urn:sdx:port:sax.net:Sax01:50", "vlan": "302"}]}'
{
  "reason": "Connection published",
  "service_id": "0fa20e7b-e957-428a-a022-55325ef65560",
  "status": "OK"
}

If later on I get information from that L2VPN, I get:

# curl http://sdx-controller:8080/SDX-Controller/l2vpn/1.0/0fa20e7b-e957-428a-a022-55325ef65560
{
  "0fa20e7b-e957-428a-a022-55325ef65560": {
    "description": null,
    "endpoints": [
      {
        "port_id": "urn:sdx:port:ampath.net:Ampath3:50",
        "vlan": "302"
      },
      {
        "port_id": "urn:sdx:port:ampath.net:Ampath1:40",
        "vlan": "4095"
      },
      {
        "port_id": "urn:sdx:port:sax.net:Sax01:40",
        "vlan": "4095"
      },
      {
        "port_id": "urn:sdx:port:sax.net:Sax01:50",
        "vlan": "302"
      }
    ],
    "name": "VLAN between AMPATH/302 and SAX/302",
    "service_id": "0fa20e7b-e957-428a-a022-55325ef65560"
  }
}

Note that now we have 4 endpoints, instead of 2.

This was using latest docker image of sdx-controller (digest 4c0f7401c248)

YufengXin commented 3 days ago

These 4 endpoints gave the provisioned path information, one request from you folks. Basically the breakdowns.

From Italo: can you please change the returned data to be comply with the Provisioning spec? The Provisioning spec states that the endpoints attribute should contain the endpoints. There is a attributed called “current_path” which could be used for showing up the breakdowns (not sure exactly the format — spec only mentions the link ID, but I suppose we can improve that )

here is an example of the get L2vpn returned data: https://docs.google.com/document/d/1YKIvNgOaoSA30coT0hvhjVGb8KSu5bNxz3fbfdOBdUY/edit?tab=t.0#bookmark=id.x7yg53g944q2