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
188b2586
Commit
188b2586
authored
8 months ago
by
Mohammad Ismaeel
Browse files
Options
Downloads
Patches
Plain Diff
Seperate Create Opticalband Msgs
parent
15584d15
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!294
Release TeraFlowSDN 4.0
,
!284
Resolve: "(CNIT) Multi-Granular Optical Nodes and Optical Transpoders management"
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/device/service/OpenConfigServicer.py
+4
-2
4 additions, 2 deletions
src/device/service/OpenConfigServicer.py
src/device/service/drivers/oc_driver/templates/VPN/roadms.py
+38
-37
38 additions, 37 deletions
src/device/service/drivers/oc_driver/templates/VPN/roadms.py
with
42 additions
and
39 deletions
src/device/service/OpenConfigServicer.py
+
4
−
2
View file @
188b2586
...
...
@@ -86,9 +86,10 @@ class OpenConfigServicer(DeviceServiceServicer):
device
=
get_device
(
context_client
,
device_uuid
,
rw_copy
=
True
,
include_endpoints
=
True
,
include_components
=
False
,
include_config_rules
=
False
)
LOGGER
.
info
(
f
"
device is
{
device
}
"
)
if
device
is
None
:
raise
NotFoundException
(
'
Device
'
,
device_uuid
,
extra_details
=
'
loading in ConfigureDevice
'
)
LOGGER
.
info
(
f
"
device is
{
device
.
name
}
"
)
resources
,
conditions
=
extract_resources
(
config
=
config
,
device
=
device
)
LOGGER
.
info
(
f
"
from openconfigservicer
{
resources
}
and conditions
{
conditions
}
"
)
driver
:
_Driver
=
get_driver
(
self
.
driver_instance_cache
,
device
)
...
...
@@ -169,9 +170,10 @@ class OpenConfigServicer(DeviceServiceServicer):
device
=
get_device
(
context_client
,
device_uuid
,
rw_copy
=
True
,
include_endpoints
=
True
,
include_components
=
False
,
include_config_rules
=
False
)
LOGGER
.
info
(
f
"
device is
{
device
}
"
)
if
device
is
None
:
raise
NotFoundException
(
'
Device
'
,
device_uuid
,
extra_details
=
'
loading in ConfigureDevice
'
)
LOGGER
.
info
(
f
"
device is
{
device
.
name
}
"
)
resources
,
conditions
=
extract_resources
(
config
=
config
,
device
=
device
)
LOGGER
.
info
(
f
"
Disable resources from openconfigservicer
{
resources
}
and conditions
{
conditions
}
"
)
driver
:
_Driver
=
get_driver
(
self
.
driver_instance_cache
,
device
)
...
...
This diff is collapsed.
Click to expand it.
src/device/service/drivers/oc_driver/templates/VPN/roadms.py
+
38
−
37
View file @
188b2586
...
...
@@ -240,47 +240,48 @@ def create_optical_band (resources) :
unwanted_keys
=
[
'
destination_port
'
,
'
source_port
'
,
'
channel_namespace
'
,
'
frequency
'
,
'
optical-band-parent
'
,
'
handled_flow
'
]
config
,
ports
,
index
=
filter_config
(
resources
,
unwanted_keys
=
unwanted_keys
)
logging
.
info
(
f
"
SSSSSSSSSSSSSSS
{
ports
}
"
)
doc
,
tag
,
text
=
Doc
().
tagtext
()
#with tag('config'):
with
tag
(
'
config
'
,
xmlns
=
"
urn:ietf:params:xml:ns:netconf:base:1.0
"
):
with
tag
(
'
wavelength-router
'
,
xmlns
=
"
http://openconfig.net/yang/wavelength-router
"
):
with
tag
(
'
optical-bands
'
,
xmlns
=
"
http://flex-scale-project.eu/yang/flex-scale-mg-on
"
):
n
=
0
for
flow
in
ports
:
#with tag('optical-band', operation="create"):
src
,
dest
=
flow
logging
.
info
(
f
"
SSSSSSSSSSSSSSS
{
src
}
,
{
dest
}
"
)
with
tag
(
'
optical-band
'
):
if
index
is
not
None
:
with
tag
(
'
index
'
):
text
(
str
(
int
(
index
)
+
n
))
with
tag
(
'
config
'
):
#if index is not None:
# with tag('index'):text(str(int(index)+i))
for
resource
in
config
:
if
resource
[
'
resource_key
'
]
==
"
index
"
:
n
=
0
for
flow
in
ports
:
doc
,
tag
,
text
=
Doc
().
tagtext
()
with
tag
(
'
config
'
,
xmlns
=
"
urn:ietf:params:xml:ns:netconf:base:1.0
"
):
with
tag
(
'
wavelength-router
'
,
xmlns
=
"
http://openconfig.net/yang/wavelength-router
"
):
with
tag
(
'
optical-bands
'
,
xmlns
=
"
http://flex-scale-project.eu/yang/flex-scale-mg-on
"
):
#with tag('optical-band', operation="create"):
src
,
dest
=
flow
logging
.
info
(
f
"
SSSSSSSSSSSSSSS
{
src
}
,
{
dest
}
"
)
with
tag
(
'
optical-band
'
):
if
index
is
not
None
:
with
tag
(
'
index
'
):
text
(
str
(
int
(
index
)
+
n
))
else
:
with
tag
(
resource
[
'
resource_key
'
]):
text
(
resource
[
'
value
'
])
with
tag
(
'
admin-status
'
):
text
(
'
ENABLED
'
)
#with tag('fiber-parent'):text(ports['destination_port'] if 'destination_port' in ports else ports['source_port'])
if
dest
is
not
None
and
dest
!=
'
0
'
:
with
tag
(
'
dest
'
):
with
tag
(
'
config
'
):
with
tag
(
'
port-name
'
):
text
(
dest
)
if
src
is
not
None
and
src
!=
'
0
'
:
with
tag
(
'
source
'
):
with
tag
(
'
config
'
):
with
tag
(
'
port-name
'
):
text
(
src
)
n
+=
1
#if index is not None:
# with tag('index'):text(str(int(index)+i))
for
resource
in
config
:
if
resource
[
'
resource_key
'
]
==
"
index
"
:
with
tag
(
'
index
'
):
text
(
str
(
int
(
index
)
+
n
))
else
:
with
tag
(
resource
[
'
resource_key
'
]):
text
(
resource
[
'
value
'
])
with
tag
(
'
admin-status
'
):
text
(
'
ENABLED
'
)
#with tag('fiber-parent'):text(ports['destination_port'] if 'destination_port' in ports else ports['source_port'])
if
dest
is
not
None
and
dest
!=
'
0
'
:
with
tag
(
'
dest
'
):
with
tag
(
'
config
'
):
with
tag
(
'
port-name
'
):
text
(
dest
)
if
src
is
not
None
and
src
!=
'
0
'
:
with
tag
(
'
source
'
):
with
tag
(
'
config
'
):
with
tag
(
'
port-name
'
):
text
(
src
)
n
+=
1
result
=
indent
(
doc
.
getvalue
(),
indentation
=
'
'
*
2
,
newline
=
''
)
results
.
append
(
result
)
result
=
indent
(
doc
.
getvalue
(),
indentation
=
'
'
*
2
,
newline
=
''
)
results
.
append
(
result
)
return
results
...
...
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