ConfD User Community

Nacm true not saving configuration into XML


#1

Hi,

I have added true in my rule list, with this what all i commit in confd_cli ( application configuration) are getting committed but not getting converted into XML.

Can anyone please let me know is it expected with nacm true, if yes then how should i make my configuration converted into XML??

Thanks in advance !

Regards,
Bibin


#2

If you want to save to XML from the CLI try something like:
C-style
# show running-config nacm | display xml | save my-nacm-backup.xml
J-style:
> show configuration nacm | display xml | save my-nacm-backup.xml

or if you want to convert ConfD values to XML, see:


#3

Hi,

Thanks for the response…

But in our application we need to convert the config to XML and parse it to our internal code, and then we read the XML.

we just use maapi_connection and get the configuration converted into XML.

code snippet:

case CDB_SUB_COMMIT:
{
for(i = 0; i < len; i++){
if(subp[i] == spoint1){
if (maapi_conn(true, CONFD_RUNNING) != 0) {
printf(“CONFD:CDB_SUB_COMMIT: maapi_conn()
failed \n”);

maapi_conn will convert the committed configuration into XML.

int flag = MAAPI_CONFIG_WITH_DEFAULTS;
flag |= MAAPI_CONFIG_XML_PRETTY;

DDBG_CONFD_WTF("Entered : %s\n", __FUNCTION__);

id = maapi_save_config(maapi_sock, thandle, flag,
                       APPLICATION_ROOT);

So we dont need the cdb_get_modification() here

Before NACM came into picture, our configuration was perfectly converting into XML, as with NACM rule list or AAA authorization the configuration are not getting converted.

true in rule-list.

if i give false then configuration is getting converted into XML fine.

Can you please share us the view regarding the two approaches. NACM as true and NACM as false.

Regards,
Bibin


#4

Hi ,

Any update on this?

Regards,
Bibin


#5

Well, you haven’t provided anywhere near enough information to give specific comments, but of course the NACM rules are in principle applied to all data access. I.e. if you start a transaction via maapi for a given user session, maapi_save_config() will only be able to save the data that the NACM rules allow access to for that user. This can be “bypassed” for access via maapi, since it is often used for “system” access. The general way is to use a user session with context “system”, see the documentation for maapi_start_user_session() in the confd_lib_maapi(3) manual page.