Skip to content
Snippets Groups Projects
Commit 16d9b2f3 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

NBI - ETSI BWM connector:

- Added missing imports
- Fixed pull-from-develop leftovers
parent 8b987b8e
No related branches found
No related tags found
2 merge requests!294Release TeraFlowSDN 4.0,!213Resolve "(CTTC) Implement NBI connector to manage Network Access Control Lists (ACLs)"
......@@ -16,11 +16,14 @@ import json, logging, re, time
from decimal import ROUND_HALF_EVEN, Decimal
from flask.json import jsonify
from common.proto.context_pb2 import (
ContextId, Empty, EndPointId, ServiceId, ServiceTypeEnum, Service, Constraint, Constraint_SLA_Capacity,
ConfigRule, ConfigRule_Custom, ConfigActionEnum)
ContextId, Empty, EndPointId, ServiceId, ServiceStatusEnum, ServiceTypeEnum,
Service, Constraint, Constraint_SLA_Capacity, ConfigRule, ConfigRule_Custom,
ConfigActionEnum
)
from common.tools.grpc.Tools import grpc_message_to_json
from common.tools.object_factory.Context import json_context_id
from common.tools.object_factory.Service import json_service_id
from common.tools.grpc.ConfigRules import update_config_rule_custom
LOGGER = logging.getLogger(__name__)
......@@ -172,14 +175,14 @@ def bwInfo_2_service(client, bw_info: dict) -> Service:
service.service_status.service_status = ServiceStatusEnum.SERVICESTATUS_PLANNED
service.service_type = ServiceTypeEnum.SERVICETYPE_L3NM
if 'appInsId' in bwInfo:
service.service_id.service_uuid.uuid = bwInfo['appInsId']
if 'appInsId' in bw_info:
service.service_id.service_uuid.uuid = bw_info['appInsId']
service.service_id.context_id.context_uuid.uuid = 'admin'
service.name = bwInfo['appInsId']
service.name = bw_info['appInsId']
if 'fixedAllocation' in bwInfo:
if 'fixedAllocation' in bw_info:
capacity = Constraint_SLA_Capacity()
capacity.capacity_gbps = float(bwInfo['fixedAllocation']) / 1.e9
capacity.capacity_gbps = float(bw_info['fixedAllocation']) / 1.e9
constraint = Constraint()
constraint.sla_capacity.CopyFrom(capacity)
service.service_constraints.append(constraint)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment