Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
opennsa3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Michal Hažlinský
opennsa3
Commits
571a05e0
Commit
571a05e0
authored
9 years ago
by
Henrik Thostrup Jensen
Browse files
Options
Downloads
Patches
Plain Diff
allow mpls and no label in nml topology generation
parent
c299c7e6
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
opennsa/constants.py
+8
-5
8 additions, 5 deletions
opennsa/constants.py
opennsa/topology/nml.py
+4
-1
4 additions, 1 deletion
opennsa/topology/nml.py
opennsa/topology/nmlxml.py
+2
-1
2 additions, 1 deletion
opennsa/topology/nmlxml.py
with
14 additions
and
7 deletions
opennsa/constants.py
+
8
−
5
View file @
571a05e0
...
...
@@ -23,20 +23,23 @@ BIDIRECTIONAL = 'Bidirectional'
EVTS_AGOLE
=
'
http://services.ogf.org/nsi/2013/07/descriptions/EVTS.A-GOLE
'
ETHERNET_NS
=
'
http://schemas.ogf.org/nml/2012/10/ethernet
'
NML_ETHERNET_VLAN
=
'
%s#vlan
'
%
ETHERNET_NS
# Port types
# port types
ETHERNET
=
'
ethernet
'
# bidirectional implied
ETHERNET_VLAN
=
'
vlan
'
MPLS
=
'
mpls
'
RESTRICTTRANSIT
=
'
restricttransit
'
# nml
ETHERNET_NS
=
'
http://schemas.ogf.org/nml/2012/10/ethernet
'
NML_ETHERNET_VLAN
=
'
%s#vlan
'
%
ETHERNET_NS
NML_MPLS
=
'
http://nsi.nordu.net/nml#mpls
'
# pretty much just made up
FEATURE_AGGREGATOR
=
'
vnd.ogf.nsi.cs.v2.role.aggregator
'
FEATURE_UPA
=
'
vnd.ogf.nsi.cs.v2.role.uPA
'
#
P
olicies
#
p
olicies
REQUIRE_USER
=
'
requireuser
'
REQUIRE_TRACE
=
'
requiretrace
'
This diff is collapsed.
Click to expand it.
opennsa/topology/nml.py
+
4
−
1
View file @
571a05e0
...
...
@@ -82,7 +82,10 @@ class BidirectionalPort(object):
assert
type
(
name
)
is
str
,
'
Port name must be a string
'
assert
isinstance
(
inbound_port
,
Port
),
'
Inbound port must be a <Port>
'
assert
isinstance
(
outbound_port
,
Port
),
'
Outbound port must be a <Port>
'
assert
inbound_port
.
label
().
type_
==
outbound_port
.
label
().
type_
,
'
Port labels must match each other
'
if
inbound_port
.
label
()
is
None
and
outbound_port
.
label
()
is
None
:
pass
# ok
else
:
assert
inbound_port
.
label
().
type_
==
outbound_port
.
label
().
type_
,
'
Port labels must match each other
'
assert
not
id_
.
startswith
(
'
urn:
'
),
'
URNs are not used in core OpenNSA NML (id: %s)
'
%
id_
self
.
id_
=
id_
...
...
This diff is collapsed.
Click to expand it.
opennsa/topology/nmlxml.py
+
2
−
1
View file @
571a05e0
...
...
@@ -53,7 +53,8 @@ NML_HASSERVICE = NML_NS + 'hasService'
NML_LABEL_MAPPING
=
{
cnt
.
ETHERNET_VLAN
:
cnt
.
NML_ETHERNET_VLAN
cnt
.
ETHERNET_VLAN
:
cnt
.
NML_ETHERNET_VLAN
,
cnt
.
MPLS
:
cnt
.
NML_MPLS
}
NSI_SERVICE_DEFINITION
=
ET
.
QName
(
'
{%s}serviceDefinition
'
%
NSI_DEF_NS
)
...
...
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