Validation init - maapi_attach


In our system, when validation is needed, it might be done in the same transaction for few yangs’ configuration.
It means that when we do the validation init we might need to do it for few name spaces.
one of the attributes in maapi_attach in the validaiton init callback is xxx__ns. can we attach more than one name space?

In the example it is all under the same yang. if there are addtional issues you thnk we might face due to the use of external DB and few yang files, I will be happy to know.


See the man page confd_lib_maapi(3):

   The hashed_ns parameter is basically just there to save a call to
   maapi_set_namespace(). We can call maapi_set_namespace() any number of
   times to change from the one we passed to maapi_attach(), and we can
   also give the namespace in prefix form in the path parameter to the
   read/write functions - see the maapi_set_namespace() description.

   If we do not want to give a specific namespace when invoking
   maapi_attach(), we can give 0 for the hashed_ns parameter (-1 works too
   but is deprecated). We can still call the read/write functions as long
   as the toplevel element in the path is unique, but otherwise we must
   call maapi_set_namespace(), or use a prefix in the path.

I.e. you attach to the transaction, not to the namespace - it’s just a convenience parameter.