Have used NCS before and used dry run api. Can’t find a method for that in confd. I currently use the confd basic version 7.2.1. If there is no support in basic is it supported in premium?
NCS config:
outputResult = t.request_action_str_th(‘services commit-dry-run outformat native’,
‘/ncs:services/commit-dry-run’)
Code below works fine but would need the dry run (as in NCS above) to check if my cmdb inventory is in sync with confd db. Or put in another way, would like to have a method checking if my settings change the confd db, i.e. a convenient diff function.
import confd
with confd.maapi.Maapi() as m:
with confd.maapi.Session(m, 'admin', 'python'):
with m.start_read_trans() as t:
root = confd.maagic.get_root(t)
#print(root.l2domain.name)
for name in root.l2domain:
print(name.name)
print(name.icl)
with confd.maapi.Maapi() as m:
with confd.maapi.Session(m, 'admin', 'python'):
with m.start_write_trans() as t:
root = confd.maagic.get_root(t)
root.l2domain.create('VSW_test3')
root.l2domain['VSW_test3'].icl = 'ae0.2345'
t.apply()