From 895c4f681e6608e2a07c0cfcdf85247b0d0be348 Mon Sep 17 00:00:00 2001 From: gifrerenom <lluis.gifre@cttc.es> Date: Thu, 20 Apr 2023 08:23:48 +0000 Subject: [PATCH] WebUI component: - Updated old get_service calls to new get_service_by_uuid - Updated old get_slice calls to new get_slice_by_uuid --- src/webui/service/service/routes.py | 13 +++++++------ src/webui/service/slice/routes.py | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/webui/service/service/routes.py b/src/webui/service/service/routes.py index 70a5b5bad..08312e525 100644 --- a/src/webui/service/service/routes.py +++ b/src/webui/service/service/routes.py @@ -18,17 +18,18 @@ import grpc from collections import defaultdict from flask import current_app, redirect, render_template, Blueprint, flash, session, url_for, request from common.proto.context_pb2 import ( - IsolationLevelEnum, Service, ServiceId, ServiceTypeEnum, ServiceStatusEnum, Connection, Empty, DeviceDriverEnum, ConfigActionEnum, Device, DeviceList) + IsolationLevelEnum, Service, ServiceId, ServiceTypeEnum, ServiceStatusEnum, Connection, Empty, DeviceDriverEnum, + ConfigActionEnum, Device, DeviceList) from common.tools.context_queries.Context import get_context from common.tools.context_queries.Topology import get_topology from common.tools.context_queries.EndPoint import get_endpoint_names -from common.tools.context_queries.Service import get_service +from common.tools.context_queries.Service import get_service_by_uuid +from common.tools.object_factory.ConfigRule import json_config_rule_set +from common.tools.object_factory.Context import json_context_id +from common.tools.object_factory.Topology import json_topology_id from context.client.ContextClient import ContextClient from service.client.ServiceClient import ServiceClient from typing import Optional, Set -from common.tools.object_factory.Topology import json_topology_id -from common.tools.object_factory.ConfigRule import json_config_rule_set -from common.tools.object_factory.Context import json_context_id service = Blueprint('service', __name__, url_prefix='/service') @@ -254,7 +255,7 @@ def detail(service_uuid: str): context_client.connect() endpoint_ids = list() - service_obj = get_service(context_client, service_uuid, rw_copy=False) + service_obj = get_service_by_uuid(context_client, service_uuid, rw_copy=False) if service_obj is None: flash('Context({:s})/Service({:s}) not found'.format(str(context_uuid), str(service_uuid)), 'danger') service_obj = Service() diff --git a/src/webui/service/slice/routes.py b/src/webui/service/slice/routes.py index cd1b672d5..a66b316b8 100644 --- a/src/webui/service/slice/routes.py +++ b/src/webui/service/slice/routes.py @@ -17,7 +17,7 @@ from flask import current_app, redirect, render_template, Blueprint, flash, sess from common.proto.context_pb2 import IsolationLevelEnum, Slice, SliceId, SliceStatusEnum from common.tools.context_queries.Context import get_context from common.tools.context_queries.EndPoint import get_endpoint_names -from common.tools.context_queries.Slice import get_slice +from common.tools.context_queries.Slice import get_slice_by_uuid from context.client.ContextClient import ContextClient from slice.client.SliceClient import SliceClient @@ -76,7 +76,7 @@ def detail(slice_uuid: str): try: context_client.connect() - slice_obj = get_slice(context_client, slice_uuid, rw_copy=False) + slice_obj = get_slice_by_uuid(context_client, slice_uuid, rw_copy=False) if slice_obj is None: flash('Context({:s})/Slice({:s}) not found'.format(str(context_uuid), str(slice_uuid)), 'danger') slice_obj = Slice() -- GitLab