ConfD User Community

Not able to get usid using getenv("CONFD_MAAPI_USID")


i want to write one application which will read some configuration commands from file and execute them.
from user guide i figured out that we can use. maapi_load_config() api for this, in order to use this i need to perform below steps from my application.

  1. maapi_connect()
  2. maapi_authenticate2 because im using external authentication.
  3. maaapi_start_user_session. with context as cli/system/non-system.

but the problem here is even though maapi_start_Seession() is returning confd_ok im getting a NULL value for getenv(“CONFD_MAAPI_USID”) and getenv(“CONFD_MAAPI_THANDLE”)
i need thandle for maapi_load_config() api.

please suggest im missing out something here.



Hello, to get user session id you can use int maapi_get_my_user_session_id(int sock), to get transaction handle, you first need to start transaction with maapi_start_trans.
BTW: maapi_load_config does not need user session id, only transaction handle.