...
Input payload:
Code Block |
---|
{ "deviceName": "CXP-2501", "interfaceName": "TCP/1/0/24", "addresses": [ { "address": "10.10.100.100", "prefix-length": "24" }, { "address": "10.10.100.221", "prefix-length": "24" }, { "address": "10.10.100.168", "prefix-length": "24" } ] } |
Desired output payload:{
Code Block |
---|
{ "dev-name": "CXP-2501", |
...
"interface-name": "TCP/1/0/24", |
...
"objects": |
...
[ { "subnet": "10.10.100.100/24" |
...
}, { "subnet": "10.10.100.221/24" |
...
}, { "subnet": "10.10.100.168/24" |
...
} ] } |
Input schema:{
Code Block |
---|
{ "deviceName": "${dName}", |
...
"interfaceName": "${iName}", |
...
"addresses": |
...
[ { "address": "${addr[*]}", |
...
"prefix-length": "${pref-len[*]}" |
...
} ] } |
Output schema:
Code Block |
---|
{ |
...
"dev-name": "${dName}", |
...
"interface-name": "${iName}", |
...
"objects": |
...
[ { "subnet": "${addr[*]}/${pref-len[*]}" |
...
} ] } |
Example-2: least schema-dependent coding using '''morpher''' “plug-in”
...