Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [
- {
- "operation": "shift",
- "spec": {
- "*": {
- "*": "&",
- "pim_network": {
- "*": {
- "*": "&",
- "addresses": {
- "*": {
- "*": "&4.&1.others.&", //the elements other than "addr_info"
- "addr_info": {
- "*": {
- "*": "&6.&3.&2[&1].&"
- }
- }
- }
- }
- }
- }
- }
- }
- },
- {
- "operation": "shift",
- "spec": {
- "*": "&",
- "pim_network": { //outermost level, eg. the level of "pim_network"
- "*": { // the indexes(0,1,2) of "pim_network" derived within the previous spec
- "addr_info": {
- "*": {
- "@2,others": { "*": "&5.&4_&2.&" }, // go two levels up the tree to grab the values of the "others" object
- "*": "&4.&3_&1.&" // &4 stands for the key literal "pim_network"
- }
- }
- }
- }
- }
- },
- { //get rid of the object keys
- "operation": "shift",
- "spec": {
- "*": "&",
- "pim_network": {
- "*": "&1[]" //add the literal "pim_network" by &1
- }
- }
- },
- {
- "operation": "shift",
- "spec": {
- "*": "&",
- "pim_network": {
- "*": {
- "family": {
- "inet": {
- "@2,ifindex": "pim_network[#4].ifindex",
- "@2,local": "pim_network[#4].ip_address",
- "@2,prefixlen": "pim_network[#4].ip_subnet",
- "@2,label": "pim_network[#4].description",
- "@2,address": "pim_network[#4].mac_address"
- }
- }
- }
- }
- }
- },
- {
- "operation": "modify-default-beta",
- "spec": {
- "pim_storage": {
- "*": {
- "asset_id": ""
- }
- },
- "pim_network": {
- "*": {
- "asset_id": ""
- }
- },
- "pim_software": {
- "*": {
- "asset_id": ""
- }
- },
- "pim_services": {
- "*": {
- "asset_id": ""
- }
- }
- }
- },
- {
- "operation": "shift",
- "spec": {
- "*": "&",
- "pim_hostname": {
- "SHORT_HOSTNAME": "hostname"
- },
- "pim_distro": {
- "PRETTY_NAME": "os_type"
- },
- "pim_hardware": {
- "processor_count": "cpu_count",
- "hw_memory": "memory"
- },
- "pim_storage": {
- "*": {
- "NAME": "pim_storage.[&1].drive_name",
- "SIZE": "pim_storage.[&1].capacity",
- "TYPE": "pim_storage.[&1].type_enum"
- }
- },
- "pim_software": {
- "*": {
- "Name": "pim_software.[&1].name",
- "Version": "pim_software.[&1].version"
- }
- },
- "pim_services": {
- "*": {
- "Id": "pim_services.[&1].id",
- "Names": "pim_services.[&1].name",
- "Description": "pim_services.[&1].friendly_name",
- "LoadState": "pim_services.[&1].loadstate",
- "ActiveState": "pim_services.[&1].state",
- "UnitFileState": "pim_services.[&1].unitfilestate",
- "UnitFilePreset": "pim_services.[&1].start_mode"
- }
- }
- }
- }
- ]
Advertisement
Add Comment
Please, Sign In to add comment