Cores: 12 cores per socket
Eve: Eve-Ng Professional running in Kvm VM on baremetal Proxmox
VT-X: VT-X is enabled
Image: no image involved
Permissions: not applcable as far as I know
File format: html/json
Logs: Contains no info regarding api calls
I'm trying to automate user- and lab management.
Therefore I wrote a script with the following content to import a comma separated userfile:
Code: Select all
#!/bin/bash
while IFS="," read -r username name email password role expiration pod pexpiration
do
curl -s -b /tmp/cookie -c /tmp/cookie -X POST -d '{"username":"admin","password":"eve"}' http://127.0.0.1/api/auth/login | jq
curl -s -c /tmp/cookie -b /tmp/cookie -X POST -d '{"path":"/opt/unetlab/labs","name":"Workspace_$username"}' -H 'Content-type: application/json' http://127.0>
curl -s -c /tmp/cookie -b /tmp/cookie -X POST -d '{"username":"$username","name":"$name","email":"$email","password":"$password","role":"$role","expiration":>
done < <(tail -n +2 sampledata)
The curl commands are respectively meant to login as admin, create a folder for a specific user and finally add the user to the eve-ng database.
All commands are closed with jq. Jq will parse the result as json.
My problem is that executing the curl command does not yield json format but html.
Image:
I tried to execute the commands without piping to jq.
I also tried to check if the system is able to return json text. Running `jq .user user.json` actually returns the username, so json is working.