Hello,
Here a working example
import ncs
with ncs.maapi.Maapi() as m:
with ncs.maapi.Session(m, 'admin', 'test_context'):
with m.start_write_trans() as trans:
root = ncs.maagic.get_root(trans)
authgroup = root.devices.authgroups.group.create("test-auth")
authgroup.default_map.create()
authgroup.default_map.remote_name="admin"
authgroup.default_map.remote_password="cisco"
trans.apply()
Before creating the authgroup using python
admin@ncs# show running-config devices authgroups group test-auth
--------------------------------------------------------^
syntax error: element does not exist
After creating the authgroup
admin@ncs# show running-config devices authgroups group test-auth
devices authgroups group test-auth
default-map remote-name admin
default-map remote-password $9$/2qQuqwlb9Y7by5opJuC/8mssOctVdvh5DBr0MdyM6Q=
!
You can use ncs_pycli that might help you in the future .