Commit e47151d6 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Pre-merge code cleanup

parent 67e371ea
Loading
Loading
Loading
Loading
+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
+5 −8
Original line number Diff line number Diff line
@@ -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
@@ -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:
+4 −5
Original line number Diff line number Diff line
@@ -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)
+2 −3
Original line number Diff line number Diff line
@@ -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'),
+1 −1

File changed.

Contains only whitespace changes.