Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info
title

Valid as of 4.0

This documentation below is valid for Datafari 4.0

...

If you want to use CURL for example, the command is :

curl -c "cookie" -XPOST 'http://localhost:8080/datafari-mcf-api-service/json/LOGIN' -d @/root/mcf/user.json

The user.json is like this :

Code Block
{
"userID":"",
"password":"xxx"
}

Replace xxx by your MCF password. We store the JSESSIONID into the cookie named cookie to reuse it for the next API commands.

So you need to always have this first call before your other commands.

For example if I want to add a new repository connection, the commands will be :

Code Block
curl -c "cookie" -XPOST 'http://localhost:8080/datafari-mcf-api-service/json/LOGIN' -d @/root/mcf/user.json

...


curl -b "cookie" -XPUT 'http://localhost:8080/datafari-mcf-api-service/json/repositoryconnections/Files' -d @/root/mcf/Files.json

Finally, if you want you can deactivate the security on the MCF API commands. Edit /opt/datafari/mcf/mcf_home/properties.xml and comment or delete the line :

...