API Script to start all nodes , eve ng pro
Posted: Wed Mar 30, 2022 9:34 pm
I feel like I'm very very close to getting this working, what I want to do is start ALL nodes in a lab.
root@eve-ng:~# curl -k -s -b /tmp/cookie -c /tmp/cookie -X POST -d '{"username":"admin","password":"eve"}' https://127.0.0.1/api/auth/login | json_pp -json_opt pretty,canonical
{
"code" : 200,
"message" : "User logged in (90013).",
"status" : "success"
}
root@eve-ng:~# curl -k -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' https://127.0.0.1/api/labs/VPNs.unl/nodes/start | json_pp -json_opt pretty,canonical
{
"code" : 400,
"message" : "Request not valid (60027).",
"status" : "fail"
}
root@eve-ng:~#
root@eve-ng:~# curl -k -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' https://127.0.0.1/api/labs/VPNs.unl/nodes/2/start | json_pp -json_opt pretty,canonical
{
"code" : 200,
"message" : "Node started (80049).",
"status" : "success"
}
root@eve-ng:~#
From the middle entry we can see that I get a fail with /nodes/start but this is the recommended syntax in the documentation. i have tried /nodes/*/start out of ideas now.
root@eve-ng:~# curl -k -s -b /tmp/cookie -c /tmp/cookie -X POST -d '{"username":"admin","password":"eve"}' https://127.0.0.1/api/auth/login | json_pp -json_opt pretty,canonical
{
"code" : 200,
"message" : "User logged in (90013).",
"status" : "success"
}
root@eve-ng:~# curl -k -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' https://127.0.0.1/api/labs/VPNs.unl/nodes/start | json_pp -json_opt pretty,canonical
{
"code" : 400,
"message" : "Request not valid (60027).",
"status" : "fail"
}
root@eve-ng:~#
root@eve-ng:~# curl -k -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' https://127.0.0.1/api/labs/VPNs.unl/nodes/2/start | json_pp -json_opt pretty,canonical
{
"code" : 200,
"message" : "Node started (80049).",
"status" : "success"
}
root@eve-ng:~#
From the middle entry we can see that I get a fail with /nodes/start but this is the recommended syntax in the documentation. i have tried /nodes/*/start out of ideas now.