01-10-2023 03:13 AM
Is it possible to read the proplist values for a service inside a MAAPI script? If so, does anyone have a code sample they could share?
01-10-2023 07:23 AM
You mean reading with a script after provisioning?
If you dump the service instance with ncs_load with flags like '-M -U -o' you will see that there is no convenient 'proplist' node.
If I remember proplist does persist so my guess would be that NSO stores proplist in the private/diff-set gibberish under the instance or somewhere else entirely. First is not useful at all, second would be cool to know if true.
02-06-2023 11:16 PM
Yes, there is a private/property-list/property list in each service instance:
In [2]: with ncs.maapi.single_read_trans('admin', 'python') as t:
...: s = ncs.maagic.get_node(t, '/foo-service{bar}')
...: for p in s.private.property_list.property:
...: print(p.name, p.value)
...:
k1 v1
k2 v2
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide