omec-project / webconsole

3 stars 12 forks source link

fix: get network slice by name and delete operation were broken #248

Closed patriciareinoso closed 1 week ago

patriciareinoso commented 1 week ago

The issue

The Network Slice is not found (404 error) even if it exists in the DB:

2024-11-07T17:21:00.891+0100    INFO    configapi/api_default.go:192    Get Network Slice by name   {"component": "WebUI", "category": "WebUI"}
2024-11-07T17:21:00.893+0100    INFO    logger/logger.go:92 | 404 |             ::1 | GET     | /config/v1/network-slice/test1 |    {"component": "WebUI", "category": "GIN"}

DB:

  {
    _id: ObjectId('672ce2ffb9f23a937192049d'),
    'slice-name': 'test1',
    'slice-id': { sst: '1', sd: '102030' },
    'site-device-group': [ 'test1-default' ],
    'site-info': {
      'site-name': 'demo',
      plmn: { mcc: '123', mnc: '11' },
      gNodeBs: [ { name: 'gnb-2', tac: 123 } ],
      upf: { 'upf-port': '123', 'upf-name': 'upf-1' }
    }
  },

Get Network Slice by Name and Delete were broken.

The Fix

After the fix on https://github.com/omec-project/webconsole/pull/244/files (configmodels/model_slice.go), the name of the network slice is stored as slice-name but on the rest of the code SliceName is still used as a filter to retrieve the Network Slices from the DB.