Support Questions
Find answers, ask questions, and share your expertise

Need help for jolt in inner array

Need help for jolt in inner array

New Contributor

input json,

 

{
"device": {
"sneID": "336 A6",
"dnsName": "dv-mse-bb",
"managementIP": "5/nokia",
"manufacturer": "Nokia",
"isMSE": "Yes",
"os": "15.0.R15-1",
"shelves": [{
"shelfID": "1",
"fabricSpeed": "A",
"cpm": "cpm5",
"isPhaseEnabled": "No",
"slots": [{
"slotID": "1",
"isSubSlot": "false",
"cards": {
"cardID": "1",
"cardType": "iom3-xp",
"adminStatus": "no shutdown",
"subSlots": [{
"slotID": "mda-1",
"isSubSlot": "true",
"cards": {
"cardID": "1/1",
"cardType": "m10-1gb-hs-sfp-b",
"adminStatus": "no shutdown",
"ports": [{
"portID": "1/1/1",
"adminStatus": "up",
"operationStatus": "up",
"speed": "1000",
"sfpType": "1000BASE-SX",
"isServicePresent": true
}

]
}
},
{
"slotID": "mda-2",
"isSubSlot": "true",
"cards": {
"cardID": "1/2",
"cardType": "m10-1gb-xp-sfp",
"adminStatus": "no shutdown",
"ports": [{
"portID": "1/2/1",
"adminStatus": "up",
"operationStatus": "down",
"speed": "1000",
"sfpType": "1000BASE-SX",
"isServicePresent": true
}

]
}
}
]
}
},

{
"slotID": "10",
"isSubSlot": "false",
"cards": {
"cardID": "10",
"cardType": "iom3-xp",
"adminStatus": "no shutdown",
"subSlots": [{
"slotID": "mda-1",
"isSubSlot": "true",
"cards": {
"cardID": "10/1",
"cardType": "m20-1gb-xp-sfp",
"adminStatus": "no shutdown",
"ports": [{
"portID": "10/1/1",
"adminStatus": "up",
"operationStatus": "up",
"speed": "1000",
"sfpType": "1000BASE-LX",
"isServicePresent": false
}


]
}
},
{
"slotID": "mda-2",
"isSubSlot": "true",
"cards": {
"cardID": "10/2",
"cardType": "m1-10gb-xp-xfp",
"adminStatus": "no shutdown",
"ports": [{
"portID": "10/2/1",
"adminStatus": "up",
"operationStatus": "up",
"speed": "10000",
"sfpType": "",
"isServicePresent": true
}]
}
}
]
}
}
]
},
{
"shelfID": "esat-1",
"ports": [{
"portID": "esat-1/1/1",
"adminStatus": "down",
"operationStatus": "down",
"speed": "1000",
"sfpType": "",
"isServicePresent": false
}


]
}
]
}
}

 

Expected output

 

{
"specType": "device",
"source": "network",
"ipAddress": {
"ip": "ip",
"dns": "dns"
},
"resourceName": "336 A6",
"resourceSpecificationRef": {
"isMSE": "Yes",
"vendor": "Nokia",
"name": "dv-mse-bb",
"subType": "5/nokia"
},
"resourceRelationship": [{
"ChassisID": "336 A6",
"specType": "chassis",
"source": "network",
"resourceName": "1",
"resourceRelationship": [{
"SlotID": "1",
"specType": "slot",
"resourceName": "1",
"resourceRelationship": [
{
"cardID": "1",
"specType": "card",
"resourceRelationship": [
{
"SpecType": "subslot",

"resourceRelationship": [
{
"SpecType": "subcard",
"subcardID": "1/1",
"resourceRelationship": [
{
"SpecType": "port",
"portid": "1/1/1"
}
},

{
"SpecType": "subcard",
"subcardID": "1/2",
"resourceRelationship": [{
"SpecType": "port",
"portid": "1/2/1"
}
}



]
}
]
]


},
{
"cardID": "10",
"specType": "card",
"resourceRelationship": [{
"SpecType": "subslot",

"resourceRelationship": [{
"SpecType": "subcard",
"subcardID": "10/1",
"resourceRelationship": [{
"SpecType": "port",
"portid": "10/1/1"
}
},

{
"SpecType": "subcard",
"subcardID": "10/2",
"resourceRelationship": [{
"SpecType": "port",
"portid": "10/2/1"
}
}


]
]
}


}
]
}
]
]