Open any LAB by API

Before posting something, READ the changelog, WATCH the videos, howto and provide following:
Your install is: Bare metal, ESXi, what CPU model, RAM, HD, what EVE version you have, output of the uname -a and any other info that might help us faster.

Moderator: mike

Post Reply
Vladisa
Posts: 3
Joined: Mon Jul 06, 2020 5:12 am

Open any LAB by API

Post by Vladisa » Tue Sep 15, 2020 9:44 am

Hi,

Could you please explain, how does it work?

curl -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' http://127.0.0.1/api/labs/User1/Lab%201.unl



I have these outputs:

root@eveng:~# curl -s -b /tmp/cookie -c /tmp/cookie -X POST -d '{"username":"User1","password":"testpassword1"}' http://127.0.0.1/api/auth/login
{"code":200,"status":"success","message":"User logged in (90013)."}
root@eveng:~#

root@eveng:~# curl -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' http://127.0.0.1/api/auth

{"code":200,"status":"success","message":"User has been loaded (90002).","data":{"email":"v@hotmail.com","folder":"\/Shared","lab":null,"lang":"en","name":"","role":"admin","tenant":"1","html5":"1","username":"User1"}}
root@eveng-isr:~#


I have my test here:
Current position / root / Shared / test.unl

When I try to load my test I receive this message
root@eveng:~# curl -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' http://127.0.0.1/api/labs/User1/test.unl
{"code":404,"status":"fail","message":"Lab does not exist (60000)."}root@eveng:~#


What is my mistake?

Vladisa
Posts: 3
Joined: Mon Jul 06, 2020 5:12 am

Re: Open any LAB by API

Post by Vladisa » Tue Sep 15, 2020 9:51 am

Ok,
no problem

The test should be moved from the folder "Current position /root/Shared" to the folder "Current position /root/User1"


root@evengr:~# curl -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' http://127.0.0.1/api/labs/User1/test.unl
{"code":200,"status":"success","message":"Lab has been loaded (60020).","data":{"author":"User1","description":"","body":"","filename":"test.unl","id":"732c2ba5-725c-4976-8e79-c2655cd134bc","name":"test","version":"1","scripttimeout":300,"lock":0}}root@eveng:~#
root@eveng:~#

Post Reply