I have Adabas running in a Docker container with the demodb running. I want to insert a record into the VEHICLES file using the Rest API. I can see in the Swagger API screen the format of the POST URL, however, I am at a loss as to providing the payload for the new record.
I can see that the data/body of the call has the following:
{ “stores”: { }, “records”: { } }
Is this where the data goes for the new record? (I assume yes)
What is “stores” and “records”?
How would I format this payload according to the VEHICLES file structure?
the entry point could be “Store:” and in newer version “Records:”.
Here an Example JSON which will insert (POST) or update (PUT) the records using classic notation with /rest/db//:
{“Store”:[{“A2”:[{“AM”:“44864858”,“AN”:“1033”}],“A1”:[{“AK”:“89300”,“AL”:“F”,“AI”:[“STREET”],“AJ”:“TEST”}],“AA”:“RINSERT1”,“AB”:[{“AC”:“INSERT”,“AD”:“”,“AE”:“TEST”}],“AQ”:[{“AT”:[138],“AS”:963,“AR”:“EUR”}],“A3”:[{“AV”:5,“AU”:19}],“AG”:“F”,“AH”:712981,“AW”:[{“AX”:19990801,“AY”:19990831}],“AF”:“M”,“AZ”:[“FRE”,“ENG”],“ISN”:1,“AO”:“VENT59”,“AP”:“CHEF DE SERVICE”}]}
Similar is possible using the Adabas MAP (/rest/map//case). There long names are used:
{“Store”:[{“Personnel-id”: “RINSERT1”,“FullName”:[{“FirstName”:“INSERT”,“Name”:“TEST”}]}]}
A rich client and tools to import/define Adabas Maps is part of an Software AG product called “Adabas Client for Java”. It is not part of a community edition.
If you know Golang you can use the Go Adabas driver to import Maps.
If you created the demo database during startup, a file called “DATA_DESIGNER” is already generated. In version 7 of Adabas Docker Community edition is providing a small web page for administration and testing. Just open the RESTful server port.