You should start with the "main.c" ususally installed in the /usr/share/yumapro/src/db-api-app directory.
Read the documentation in the Server Overview Manual
https://docs.yumaworks.com/en/latest/ypserver/db-api.html
The code snippet I attached in DB-API-Init-Code-Snippet.txt is basically patterned after your main.c in /usr/share/yumapro/src/db-api-app directory.
There are a couple of items I see from the Makefile supplied in that directory that are missing in my installation of your SDK. For one there is this refererence to a library, sendbuff, that I am been unable to locate in any Open Source or Linux Distribution:
LIBS = -lyumapro_db-api \
-lyumapro_ycontrol -lsendbuff \
-lyumapro_ncx -lxml2 -lz -lm
For the other, there are references to subsys-pro library objects for which I cannot locate within the YumaWorks SDK installation:
SUBSYS_TARGET=$(TBASE)/subsys-pro
LOBJS = $(SUBSYS_TARGET)/subsystem.o
LOBJS += $(SUBSYS_TARGET)/subsys_util.o
If I attempt to build the db-api-app using this Makefile, I get the following error:
...share/yumapro/src/db-api-app> sudo make all
Compiling in C++11 mode
make: *** No rule to make target 'procdefs.h', needed by '../../target/db-api-app/main.o'. Stop.
As I previously mentioned, I am able to compile and link my test application without these referenced library or library objects using the specified APIs from the main.c for db-api-app along with using the specified libraries from above.
It is obvious I am missing something in my development environment to pull in the necessary subsys-pro elements required for registering the DB-API service and to compile the test program for db-api-app.
I have tried running the db-api-app program installed in /usr/bin and I see from the netconfd-pro server.log the DB-API service is being registered from this application:
agt_ycontrol: Got <ycontrol> message:
yctl:ycontrol {
message-id 1
message-type subsys-request
server-id
subsys-id subsys1
service-id db-api
payload {
ydb:db-api {
register-request
}
}
}
DB-API: enter service function
DB-API: enter subsys_request
ycontrol_msg: sending server-response # 1 for db-api
<?xml version="1.0" encoding="UTF-8"?>
<ycontrol xmlns="http://yumaworks.com/ns/yumaworks-ycontrol">
<message-id>1</message-id>
<message-type>server-response</message-type>
<server-id>server1</server-id>
<subsys-id>subsys1</subsys-id>
<service-id>db-api</service-id>
<ok/>
</ycontrol>
Thanks.
This problem is now resolved with my test program using the libraries and object files built from sources provided in our purchased product.
Brian.Tinsley
Following the steps described in the online documentation for the YControl initialization and DB-API Service Registration, I am unable to get the DB-API Service ready via the function call, db_api_service_ready, within a test program I created.
Please see the attached files which document the test program, the program output, netconfd-pro configuration setup (bundle and module names removed), netconfd-pro server log (debug4), and strace output from the test program.
YumaPro SDK Basic installed is 21.10-5-1fcb and this is running on RHEL 8.6.