Export over api differs from export over terminal

Hello,

I am testing the api usage and had written a little python-script based of RouterOS_API from LaiArturs (https://github.com/LaiArturs/RouterOS_API).
I used the command

"/system/package/update/install"

to upgrade my test router from 6.47.3 to 6.47.4 and used

"/export", "=file=Testrouter"

to generate an export file (on the router).
To check if the export is fine I used the export command in the terminal to create a second file and they differ.
Diff.PNG
The configuration is complet but “yes” is replace by “true” and “no” with “false”. These commands from the api export can’t to recreate the configuration.
Is this the normal behavior of the api or is there a problem in the project from LaiArturs?

The Router is a RB2011UiAS-RM.

It is not the lib problem. Unfortunately at the moment API behaves like this.

Thanks mrz,

As I have seen, I cannot bypass the behavior by calling a backup script on the mikrotik router.

No somehow the dialect is bound to the connection context. Can’t you use ssh to export your configuration as it’s just a single command?

When this is the only difference, maybe it is possible to change the file with some global substitutes? (e.g. using sed or some extra code in your program that calls the API)

I ran into the API not having some operation to get the config without using the flash. I didn’t even get to this yes/no true/false issue… ButIf you are cool with it writing to the flash, you can do a two step process:

rosconn.write('/system/script/add', [ '=name=apiexport', '=source=/export file=apiexport.rsc' ])
rosconn.write('/system/script/run', [ '=number=apiexport' ] )

You’d have to adjust the code for API client you’re using, probably delete the script after, etc.

My opinion is that the CLI/import should just accept either version of the booleans (yes or true, no or false). I run into the reverse problem, where I do something like “enable=true” in the CLI to then be reminded by the CLI something is wrong…