Uploaded image for project: 'Virtual Function Controller'
  1. Virtual Function Controller
  2. VFC-957

Incompatibility between swagger API and source code

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Low Low
    • Casablanca Release
    • Casablanca Release

      Incompatibility between swagger API and source code.
      In lcm/lcm/swagger/vfc.vnfdriver.swagger.json, the post request to
      "/nslcm/v1/ns/

      {vnfmid}

      /vnfs/

      {vnfInstanceId}

      /Notify" expects
      1. vnfmid
      2. vnfInstanceId and
      3. VNFLCMNotification

      the VNFLCMNotification structure has the following attributes :
      1. status
      2. vnfInstanceId
      3. operation
      4. jobId
      5. affectedVnfc
      6. affectedCp
      7. affectedVl
      8. affectedVirtualStorage

      But when we look at the source code,
      In lcm/lcm/ns/vnfs/urls.py
      url(r'^api/nslcm/v1/ns/(?P<vnfmid>[0-9a-zA-Z_-])/vnfs/(?P<vnfInstanceId>[0-9a-zA-Z_-])/Notify$', LcmNotify.as_view()),

      In lcm/lcm/ns/vnfs/views.py,
      class LcmNotify(APIView):
      ...
      def post(self, request, vnfmid, vnfInstanceId):
      ...
      NotifyLcm(vnfmid, vnfInstanceId, request.data).do_biz()

      In lcm/lcm/ns/vnfs/notify_lcm.py,

      class NotifyLcm(object):
      def _init_(self, vnfmid, vnfInstanceId, data):
      ...

      • self.vnfdmodule = ignore_case_get(data, 'vnfdmodule')*

      Here, the vnfdmodule parameter is not a part of the VNFLCMNotification structure but it is expected. Though it doesnt throw any error, it is making the code incompatible with the swagger api.

      Also, ZTE alone is currently filling up this parameter while sending a POST request call.
      It would be good to update the swagger API with the vnfdmodule parameter as well.

            avs_aditya avs_aditya
            aditya_avs aditya_avs
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: