Loading src/nbi/service/rest_server/nbi_plugins/ietf_hardware/HardwareMultipleDevices.py +15 −1 Original line number Diff line number Diff line # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import logging from flask import request from flask.json import jsonify Loading src/nbi/service/rest_server/nbi_plugins/ietf_hardware/YangHandler.py +5 −8 Original line number Diff line number Diff line Loading @@ -92,7 +92,6 @@ class YangHandler: component_type = component_type.replace("_", "-").lower() component_type = 'iana-hardware:' + component_type component_new.create_path('class', component_type) #Añadir resto de atributos en IETF Loading Loading @@ -137,8 +136,6 @@ class YangHandler: continue component_new.create_path('uri', component.name) component_new.create_path('uuid', component.component_uuid.uuid) for child in device.components: Loading src/nbi/service/rest_server/nbi_plugins/ietf_hardware/__init__.py +4 −5 Original line number Diff line number Diff line Loading @@ -16,10 +16,9 @@ from nbi.service.rest_server.nbi_plugins.ietf_hardware.Hardware import Hardware from nbi.service.rest_server.nbi_plugins.ietf_hardware.HardwareMultipleDevices import HardwareMultipleDevices from nbi.service.rest_server.RestServer import RestServer URL_PREFIX_device = "/restconf/data/device=<path:device_uuid>/ietf-network-hardware-inventory:network-hardware-inventory" URL_PREFIX_hardware = "/restconf/data/ietf-network-hardware-inventory:network-hardware-inventory" URL_PREFIX_DEVICE = "/restconf/data/device=<path:device_uuid>/ietf-network-hardware-inventory:network-hardware-inventory" URL_PREFIX_HARDWARE = "/restconf/data/ietf-network-hardware-inventory:network-hardware-inventory" def register_ietf_hardware(rest_server: RestServer): rest_server.add_resource(Hardware, URL_PREFIX_device) rest_server.add_resource(HardwareMultipleDevices, URL_PREFIX_hardware) No newline at end of file rest_server.add_resource(Hardware, URL_PREFIX_DEVICE) rest_server.add_resource(HardwareMultipleDevices, URL_PREFIX_HARDWARE) src/nbi/service/rest_server/nbi_plugins/tfs_api/__init__.py +2 −3 Original line number Diff line number Diff line Loading @@ -49,9 +49,8 @@ RESOURCES = [ ('api.slice', Slice, '/context/<path:context_uuid>/slice/<path:slice_uuid>'), ('api.device_ids', DeviceIds, '/device_ids'), ('api.devices', HardwareMultipleDevices, '/devices'), ('api.device', Hardware, '/device/<path:device_uuid>'), ('api.devices', Devices, '/devices'), ('api.device', Device, '/device/<path:device_uuid>'), ('api.link_ids', LinkIds, '/link_ids'), ('api.links', Links, '/links'), Loading src/nbi/service/rest_server/nbi_plugins/ietf_hardware/Hardware.py +1 −1 File changed.Contains only whitespace changes. Show changes Loading
src/nbi/service/rest_server/nbi_plugins/ietf_hardware/HardwareMultipleDevices.py +15 −1 Original line number Diff line number Diff line # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import logging from flask import request from flask.json import jsonify Loading
src/nbi/service/rest_server/nbi_plugins/ietf_hardware/YangHandler.py +5 −8 Original line number Diff line number Diff line Loading @@ -92,7 +92,6 @@ class YangHandler: component_type = component_type.replace("_", "-").lower() component_type = 'iana-hardware:' + component_type component_new.create_path('class', component_type) #Añadir resto de atributos en IETF Loading Loading @@ -137,8 +136,6 @@ class YangHandler: continue component_new.create_path('uri', component.name) component_new.create_path('uuid', component.component_uuid.uuid) for child in device.components: Loading
src/nbi/service/rest_server/nbi_plugins/ietf_hardware/__init__.py +4 −5 Original line number Diff line number Diff line Loading @@ -16,10 +16,9 @@ from nbi.service.rest_server.nbi_plugins.ietf_hardware.Hardware import Hardware from nbi.service.rest_server.nbi_plugins.ietf_hardware.HardwareMultipleDevices import HardwareMultipleDevices from nbi.service.rest_server.RestServer import RestServer URL_PREFIX_device = "/restconf/data/device=<path:device_uuid>/ietf-network-hardware-inventory:network-hardware-inventory" URL_PREFIX_hardware = "/restconf/data/ietf-network-hardware-inventory:network-hardware-inventory" URL_PREFIX_DEVICE = "/restconf/data/device=<path:device_uuid>/ietf-network-hardware-inventory:network-hardware-inventory" URL_PREFIX_HARDWARE = "/restconf/data/ietf-network-hardware-inventory:network-hardware-inventory" def register_ietf_hardware(rest_server: RestServer): rest_server.add_resource(Hardware, URL_PREFIX_device) rest_server.add_resource(HardwareMultipleDevices, URL_PREFIX_hardware) No newline at end of file rest_server.add_resource(Hardware, URL_PREFIX_DEVICE) rest_server.add_resource(HardwareMultipleDevices, URL_PREFIX_HARDWARE)
src/nbi/service/rest_server/nbi_plugins/tfs_api/__init__.py +2 −3 Original line number Diff line number Diff line Loading @@ -49,9 +49,8 @@ RESOURCES = [ ('api.slice', Slice, '/context/<path:context_uuid>/slice/<path:slice_uuid>'), ('api.device_ids', DeviceIds, '/device_ids'), ('api.devices', HardwareMultipleDevices, '/devices'), ('api.device', Hardware, '/device/<path:device_uuid>'), ('api.devices', Devices, '/devices'), ('api.device', Device, '/device/<path:device_uuid>'), ('api.link_ids', LinkIds, '/link_ids'), ('api.links', Links, '/links'), Loading
src/nbi/service/rest_server/nbi_plugins/ietf_hardware/Hardware.py +1 −1 File changed.Contains only whitespace changes. Show changes