I am working on a project which I need to set CDB stored operation data (tailf:cdb-oper) in CDB.
I can see there are C APIs and Python APIs to do writing. I just wonder whether there is Java API which can write to CDB similar as C or Python APIs ?
Or is there any other approach which can write the CDB stored operation data ?
Ok, I got the JAVA API and try to use it to write operational data to CDB. But I found the operational data can’t be written to CDB. The below is my codes
int port = Conf.PORT;
Socket s = new Socket("localhost", port);
Cdb cdbReadSocket = new Cdb("MyReadCdbSocket", s);
CdbSession cdbSession = cdbReadSocket.startSession(CdbDBType.CDB_OPERATIONAL);
cdbSession.setElem(new ConfHexString("12345"), "/system/information/version");
cdbSession.endSession();
s.close();
Unfortunately, I can’t find a complete code example such as writting operational data to CDB. Any idea why my code doesn’t work ?