Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TFS
controller
Commits
5f64f0ea
Commit
5f64f0ea
authored
1 year ago
by
Shayan Hajipour
Browse files
Options
Downloads
Patches
Plain Diff
service_2_bwInfo function bug resolved: change in config rules applied in the function
parent
f6afa0c7
No related branches found
No related tags found
2 merge requests
!294
Release TeraFlowSDN 4.0
,
!196
Resolve "(CTTC) Incorrect endpoint lookup in NBI ETSI BWM plugin"
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/nbi/service/rest_server/nbi_plugins/etsi_bwm/Tools.py
+13
-8
13 additions, 8 deletions
src/nbi/service/rest_server/nbi_plugins/etsi_bwm/Tools.py
with
13 additions
and
8 deletions
src/nbi/service/rest_server/nbi_plugins/etsi_bwm/Tools.py
+
13
−
8
View file @
5f64f0ea
...
@@ -31,7 +31,7 @@ LOGGER = logging.getLogger(__name__)
...
@@ -31,7 +31,7 @@ LOGGER = logging.getLogger(__name__)
ENDPOINT_SETTINGS_KEY
=
'
/device[{:s}]/endpoint[{:s}]/vlan[{:d}]/settings
'
ENDPOINT_SETTINGS_KEY
=
'
/device[{:s}]/endpoint[{:s}]/vlan[{:d}]/settings
'
DEVICE_SETTINGS_KEY
=
'
/device[{:s}]/settings
'
DEVICE_SETTINGS_KEY
=
'
/device[{:s}]/settings
'
RE_CONFIG_RULE_IF_SUBIF
=
re
.
compile
(
r
'
^\/interface\[([^\]]+)\]\/subinterface\[([^\]]+)\]$
'
)
RE_CONFIG_RULE_IF_SUBIF
=
re
.
compile
(
r
'
^\/interface\[([^\]]+)\]\/subinterface\[([^\]]+)\]$
'
)
MEC_CONSIDERED_FIELDS
=
[
'
requestType
'
,
'
sessionFilter
'
,
'
fixedAllocation
'
,
'
allocationDirection
'
]
MEC_CONSIDERED_FIELDS
=
[
'
requestType
'
,
'
sessionFilter
'
,
'
fixedAllocation
'
,
'
allocationDirection
'
,
'
fixedBWPriority
'
]
ALLOCATION_DIRECTION_DESCRIPTIONS
=
{
ALLOCATION_DIRECTION_DESCRIPTIONS
=
{
'
00
'
:
'
Downlink (towards the UE)
'
,
'
00
'
:
'
Downlink (towards the UE)
'
,
'
01
'
:
'
Uplink (towards the application/session)
'
,
'
01
'
:
'
Uplink (towards the application/session)
'
,
...
@@ -59,12 +59,19 @@ def service_2_bwInfo(service: Service) -> dict:
...
@@ -59,12 +59,19 @@ def service_2_bwInfo(service: Service) -> dict:
break
break
for
config_rule
in
service
.
service_config
.
config_rules
:
for
config_rule
in
service
.
service_config
.
config_rules
:
resource_value_json
=
json
.
loads
(
config_rule
.
custom
.
resource_value
)
if
config_rule
.
custom
.
resource_key
!=
'
/request
'
:
continue
for
key
in
[
'
allocationDirection
'
,
'
fixedBWPriority
'
,
'
requestType
'
,
'
sourceIp
'
,
'
sourcePort
'
,
'
dstPort
'
,
'
protocol
'
,
'
sessionFilter
'
]:
for
key
in
[
'
allocationDirection
'
,
'
fixedBWPriority
'
,
'
requestType
'
,
'
sourceIp
'
,
'
sourcePort
'
,
'
dstPort
'
,
'
protocol
'
,
'
sessionFilter
'
]:
if
config_rule
.
custom
.
resource_key
==
key
:
if
key
not
in
resource_value_json
:
if
key
!=
'
sessionFilter
'
:
continue
response
[
key
]
=
config_rule
.
custom
.
resource_value
else
:
if
key
==
'
sessionFilter
'
:
response
[
key
]
=
json
.
loads
(
config_rule
.
custom
.
resource_value
)
response
[
key
]
=
[
resource_value_json
[
key
]]
elif
key
==
'
requestType
'
:
response
[
key
]
=
str
(
resource_value_json
[
key
])
else
:
response
[
key
]
=
resource_value_json
[
key
]
unixtime
=
time
.
time
()
unixtime
=
time
.
time
()
response
[
'
timeStamp
'
]
=
{
# Time stamp to indicate when the corresponding information elements are sent
response
[
'
timeStamp
'
]
=
{
# Time stamp to indicate when the corresponding information elements are sent
...
@@ -76,8 +83,6 @@ def service_2_bwInfo(service: Service) -> dict:
...
@@ -76,8 +83,6 @@ def service_2_bwInfo(service: Service) -> dict:
def
bwInfo_2_service
(
client
,
bw_info
:
dict
)
->
Service
:
def
bwInfo_2_service
(
client
,
bw_info
:
dict
)
->
Service
:
# add description to allocationDirection code
# add description to allocationDirection code
if
ad_code
:
=
bw_info
.
get
(
'
allocationDirection
'
):
bw_info
[
'
allocationDirection
'
]
=
{
'
code
'
:
ad_code
,
'
description
'
:
ALLOCATION_DIRECTION_DESCRIPTIONS
[
ad_code
]}
if
'
sessionFilter
'
in
bw_info
:
if
'
sessionFilter
'
in
bw_info
:
bw_info
[
'
sessionFilter
'
]
=
bw_info
[
'
sessionFilter
'
][
0
]
# Discard other items in sessionFilter field
bw_info
[
'
sessionFilter
'
]
=
bw_info
[
'
sessionFilter
'
][
0
]
# Discard other items in sessionFilter field
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment