Files
oopt-gnpy/tests/data/convert/testTopology_testservices.json
EstherLerouzic 1a795639c7 feat: Add conversion utilities for YANG and legacy formats in GNPy
This commit introduces new functions for converting between YANG formatted files and
legacy formats. The conversion processes adhere to RFC7951 for encoding YANG data.

Key changes include:
- Conversion of float and empty type representations.
- Transformation of Span and SI lists xx_power_range into dictionaries.
- Addition of necessary namespaces.
- use of oopt-gnpy-libyang to enforce compliancy to yang models

These utilities enable full compatibility with GNPy.

Co-authored-by: Renato Ambrosone <renato.ambrosone@polito.it>

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ia004113bca2b0631d1648564e5ccb60504fe80f8
2025-09-03 10:34:14 +02:00

516 lines
13 KiB
JSON

{
"path-request": [
{
"request-id": "1",
"source": "trx a",
"destination": "trx g",
"src-tp-id": "trx a",
"dst-tp-id": "trx g",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
"trx_type": "Voyager_16QAM",
"trx_mode": "16QAM",
"spacing": 50000000000.0,
"max-nb-of-channel": 80,
"output-power": 0.001,
"path_bandwidth": 300000000000.0
}
}
},
{
"request-id": "2a",
"source": "trx a",
"destination": "trx h",
"src-tp-id": "trx a",
"dst-tp-id": "trx h",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
"trx_type": "vendorA_trx-type1",
"trx_mode": "PS_SP64_1",
"spacing": 50000000000.0,
"max-nb-of-channel": 80,
"output-power": 0.0012356,
"path_bandwidth": 300000000000.0
}
}
},
{
"request-id": "3",
"source": "trx f",
"destination": "trx b",
"src-tp-id": "trx f",
"dst-tp-id": "trx b",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
"trx_type": "vendorA_trx-type1",
"trx_mode": "PS_SP64_1",
"spacing": 50000000000.0,
"max-nb-of-channel": 80,
"output-power": 0.001,
"path_bandwidth": 300000000000.0
}
}
},
{
"request-id": "ee",
"source": "trx c",
"destination": "trx f",
"src-tp-id": "trx c",
"dst-tp-id": "trx f",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
"trx_type": "vendorA_trx-type1",
"trx_mode": "PS_SP64_1",
"spacing": 50000000000.0,
"max-nb-of-channel": 80,
"output-power": 0.001,
"path_bandwidth": 300000000000.0
}
},
"explicit-route-objects": {
"route-object-include-exclude": [
{
"index": 0,
"explicit-route-usage": "route-include-ero",
"num-unnum-hop": {
"node-id": "roadm e",
"hop-type": "LOOSE"
}
},
{
"index": 1,
"explicit-route-usage": "route-include-ero",
"num-unnum-hop": {
"node-id": "roadm g",
"link-tp-id": "link-tp-id is not used",
"hop-type": "LOOSE"
}
}
]
}
},
{
"request-id": "ff",
"source": "trx c",
"destination": "trx f",
"src-tp-id": "trx c",
"dst-tp-id": "trx f",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
"trx_type": "Voyager",
"trx_mode": "mode 2 - fake",
"spacing": 75000000000.0,
"max-nb-of-channel": 63,
"output-power": 0.001,
"path_bandwidth": 300000000000.0
}
}
},
{
"request-id": "10",
"source": "trx a",
"destination": "trx g",
"src-tp-id": "trx a",
"dst-tp-id": "trx g",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
"trx_type": "Voyager",
"trx_mode": "mode 2",
"spacing": 75000000000.0,
"max-nb-of-channel": 63,
"output-power": 0.001,
"path_bandwidth": 300000000000.0
}
}
},
{
"request-id": "11",
"source": "trx a",
"destination": "trx h",
"src-tp-id": "trx a",
"dst-tp-id": "trx h",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
"trx_type": "vendorA_trx-type1",
"trx_mode": "PS_SP64_1",
"spacing": 50000000000.0,
"max-nb-of-channel": 80,
"output-power": 0.001,
"path_bandwidth": 300000000000.0
}
},
"explicit-route-objects": {
"route-object-include-exclude": [
{
"index": 0,
"explicit-route-usage": "route-include-ero",
"num-unnum-hop": {
"node-id": "bb",
"link-tp-id": "link-tp-id is not used",
"hop-type": "LOOSE"
}
}
]
}
},
{
"request-id": "12",
"source": "trx f",
"destination": "trx b",
"src-tp-id": "trx f",
"dst-tp-id": "trx b",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
"trx_type": "Voyager",
"trx_mode": "mode 3",
"spacing": 62500000000.0,
"max-nb-of-channel": 76,
"output-power": 0.001,
"path_bandwidth": 300000000000.0
}
},
"explicit-route-objects": {
"route-object-include-exclude": [
{
"index": 0,
"explicit-route-usage": "route-include-ero",
"num-unnum-hop": {
"node-id": "trx b",
"link-tp-id": "link-tp-id is not used",
"hop-type": "LOOSE"
}
}
]
}
},
{
"request-id": "13",
"source": "trx c",
"destination": "trx f",
"src-tp-id": "trx c",
"dst-tp-id": "trx f",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
"trx_type": "vendorA_trx-type1",
"trx_mode": "PS_SP64_1",
"spacing": 50000000000.0,
"max-nb-of-channel": 80,
"output-power": 0.001,
"path_bandwidth": 300000000000.0
}
}
},
{
"request-id": "14",
"source": "trx c",
"destination": "trx f",
"src-tp-id": "trx c",
"dst-tp-id": "trx f",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
"trx_type": "vendorA_trx-type1",
"trx_mode": "PS_SP64_1",
"spacing": 50000000000.0,
"max-nb-of-channel": 80,
"output-power": 0.001,
"path_bandwidth": 300000000000.0
}
},
"explicit-route-objects": {
"route-object-include-exclude": [
{
"index": 0,
"explicit-route-usage": "route-include-ero",
"num-unnum-hop": {
"node-id": "roadm e",
"hop-type": "LOOSE"
}
},
{
"index": 1,
"explicit-route-usage": "route-include-ero",
"num-unnum-hop": {
"node-id": "roadm g",
"link-tp-id": "link-tp-id is not used",
"hop-type": "LOOSE"
}
}
]
}
},
{
"request-id": "e:1# /",
"source": "trx a",
"destination": "trx g",
"src-tp-id": "trx a",
"dst-tp-id": "trx g",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
"trx_type": "Voyager_16QAM",
"trx_mode": "16QAM",
"spacing": 50000000000.0,
"max-nb-of-channel": 80,
"output-power": null,
"path_bandwidth": 300000000000.0
}
}
},
{
"request-id": "b-2a",
"source": "trx a",
"destination": "trx h",
"src-tp-id": "trx a",
"dst-tp-id": "trx h",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
"trx_type": "Voyager",
"trx_mode": "mode 1",
"spacing": 50000000000.0,
"max-nb-of-channel": null,
"output-power": 0.001,
"path_bandwidth": 300000000000.0
}
}
},
{
"request-id": "3a;?",
"source": "trx f",
"destination": "trx b",
"src-tp-id": "trx f",
"dst-tp-id": "trx b",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
"trx_type": "vendorA_trx-type1",
"trx_mode": "PS_SP64_1",
"spacing": 50000000000.0,
"max-nb-of-channel": null,
"output-power": null,
"effective-freq-slot": [
{
"N": null,
"M": null
}
],
"path_bandwidth": 300000000000.0
}
}
},
{
"request-id": "ee-s",
"source": "trx c",
"destination": "trx f",
"src-tp-id": "trx c",
"dst-tp-id": "trx f",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
"trx_type": "vendorA_trx-type1",
"trx_mode": null,
"spacing": 50000000000.0,
"max-nb-of-channel": 80,
"output-power": 0.001,
"effective-freq-slot": [
{
"N": 0,
"M": 4
}, {
"N": 8,
"M": 4
}
],
"path_bandwidth": 300000000000.0
}
},
"explicit-route-objects": {
"route-object-include-exclude": [
{
"index": 0,
"explicit-route-usage": "route-include-ero",
"num-unnum-hop": {
"node-id": "roadm e",
"hop-type": "LOOSE"
}
},
{
"index": 1,
"explicit-route-usage": "route-include-ero",
"num-unnum-hop": {
"node-id": "roadm g",
"link-tp-id": "link-tp-id is not used",
"hop-type": "LOOSE"
}
}
]
}
},
{
"request-id": "ff-b",
"source": "trx c",
"destination": "trx f",
"src-tp-id": "trx c",
"dst-tp-id": "trx f",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
"trx_type": "Voyager",
"trx_mode": null,
"spacing": 50000000000.0,
"max-nb-of-channel": null,
"output-power": 0.001,
"path_bandwidth": 300000000000.0
}
}
},
{
"request-id": "10-z",
"source": "trx a",
"destination": "trx g",
"src-tp-id": "trx a",
"dst-tp-id": "trx g",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
"trx_type": "Voyager",
"trx_mode": null,
"spacing": 75000000000.0,
"max-nb-of-channel": 63,
"output-power": null,
"path_bandwidth": 300000000000.0
}
}
},
{
"request-id": "11 g",
"source": "trx a",
"destination": "trx h",
"src-tp-id": "trx a",
"dst-tp-id": "trx h",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
"trx_type": "Voyager",
"trx_mode": null,
"spacing": 50000000000.0,
"max-nb-of-channel": null,
"output-power": null,
"path_bandwidth": 300000000000.0
}
}
},
{
"request-id": "12<",
"source": "trx f",
"destination": "trx b",
"src-tp-id": "trx f",
"dst-tp-id": "trx b",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
"trx_type": "Voyager",
"trx_mode": null,
"spacing": 75000000000.0,
"max-nb-of-channel": null,
"output-power": null,
"path_bandwidth": 300000000000.0
}
}
},
{
"request-id": "12>",
"source": "trx f",
"destination": "trx b",
"src-tp-id": "trx f",
"dst-tp-id": "trx b",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
"trx_type": "Voyager",
"trx_mode": null,
"spacing": 30000000000.0,
"max-nb-of-channel": null,
"output-power": null,
"path_bandwidth": 300000000000.0
}
}
}
],
"synchronization": [
{
"synchronization-id": "1",
"svec": {
"relaxable": false,
"disjointness": "node link",
"request-id-number": [
"1",
"2a"
]
}
},
{
"synchronization-id": "3",
"svec": {
"relaxable": false,
"disjointness": "node link",
"request-id-number": [
"3",
"1"
]
}
},
{
"synchronization-id": "ff",
"svec": {
"relaxable": false,
"disjointness": "node link",
"request-id-number": [
"ff",
"13"
]
}
},
{
"synchronization-id": "13",
"svec": {
"relaxable": false,
"disjointness": "node link",
"request-id-number": [
"13",
"14"
]
}
}
]
}