Hi Guys,
we want to export all hosts, network and group objects so we can import them into another management.
For networks:
mgmt_cli -m localhost -s sid.txt show networks --format json | jq '.objects[] | {name, subnet4, "mask-length4"}'
Output:
"name": "CP_default_Office_Mode_addresses_pool",
"subnet4": "172.16.10.0",
"mask-length4": 24
}
{
"name": "IPv6_Link_Local_Hosts",
"subnet4": null,
"mask-length4": null
}
{
"name": "test-network",
"subnet4": "192.168.0.0",
"mask-length4": 16
}
Hosts:
mgmt_cli -m localhost -s sid.txt show hosts --format json | jq '.objects[] | {name, "ipv4-address"}'
Output:
"name": "test1",
"ipv4-address": "1.1.1.1"
}
{
"name": "test2",
"ipv4-address": "2.2.2.2"
}
The only issue I have are the groups:
mgmt_cli -m localhost -s sid.txt show groups details-level "full" --format json | jq '.objects[] | {name, members}'
Output:
"name": "testgroup",
"members": [
"a25ca22d-1494-49d2-89a5-f7dc6a804aa5",
"6d6903bc-aa68-4446-821d-50d0aa33dcc4"
]
The members only show with the UUID and not in clear-text.
Yes, I can manually search for the UUID but it seems pretty uncomfortable to me:
mgmt_cli -m localhost -s sid.txt show object uid "a25ca22d-1494-49d2-89a5-f7dc6a804aa5" --format json | jq '.object | {name, type, "ipv4-address"}'
"name": "test1",
"type": "host",
"ipv4-address": "1.1.1.1"
In contrast If I search for one specific group instead of "show groups" the members are shown in cleartext.
Any suggestions how to improve this?