mirror of
https://github.com/Telecominfraproject/oopt-gnpy.git
synced 2025-11-01 10:38:10 +00:00
Add N and M in the json response
The label object is added in the response. It contains center index N value and number of slots M, required by the request according to the computation. The label object directly follows the hop attribute as detailed in draft-ietf-teas-yang-path-computation. If the path is not blocked this changes the index of the last hop information (-3 instead of -2) and the index of the transponder for the first hop (2 instead of 1) Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
This commit is contained in:
@@ -137,6 +137,18 @@ class Result_element(Element):
|
|||||||
}
|
}
|
||||||
pro_list.append(temp)
|
pro_list.append(temp)
|
||||||
index += 1
|
index += 1
|
||||||
|
if self.path_request.M > 0:
|
||||||
|
temp = {
|
||||||
|
'path-route-object': {
|
||||||
|
'index': index,
|
||||||
|
"label-hop": {
|
||||||
|
"N": self.path_request.N,
|
||||||
|
"M": self.path_request.M
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pro_list.append(temp)
|
||||||
|
index += 1
|
||||||
if isinstance(element, Transceiver) :
|
if isinstance(element, Transceiver) :
|
||||||
temp = {
|
temp = {
|
||||||
'path-route-object': {
|
'path-route-object': {
|
||||||
@@ -523,10 +535,10 @@ def jsontocsv(json_data, equipment, fileout):
|
|||||||
# when label will be assigned destination will be with index -3, and transponder with index 2
|
# when label will be assigned destination will be with index -3, and transponder with index 2
|
||||||
source = pth_el['path-properties']['path-route-objects'][0]\
|
source = pth_el['path-properties']['path-route-objects'][0]\
|
||||||
['path-route-object']['num-unnum-hop']['node-id']
|
['path-route-object']['num-unnum-hop']['node-id']
|
||||||
destination = pth_el['path-properties']['path-route-objects'][-2]\
|
destination = pth_el['path-properties']['path-route-objects'][-3]\
|
||||||
['path-route-object']['num-unnum-hop']['node-id']
|
['path-route-object']['num-unnum-hop']['node-id']
|
||||||
# selects only roadm nodes
|
# selects only roadm nodes
|
||||||
temp_tsp = pth_el['path-properties']['path-route-objects'][1]\
|
temp_tsp = pth_el['path-properties']['path-route-objects'][2]\
|
||||||
['path-route-object']['transponder']
|
['path-route-object']['transponder']
|
||||||
tsp = temp_tsp['transponder-type']
|
tsp = temp_tsp['transponder-type']
|
||||||
mode = temp_tsp['transponder-mode']
|
mode = temp_tsp['transponder-mode']
|
||||||
|
|||||||
Reference in New Issue
Block a user