API node call always returns empty console port number. Node is up and running and using web UI console port number is visible. Is there any way how to get it or is it a bug?
Example:
"16": {
"console": "",
"delay": 0,
"id": 16,
"left": 234,
"icon": "Router.png",
"image": "i86bi-linux-l3-adventerprisek9-15.2.4M1.bin",
"name": "R16",
"ram": 512,
"status": 2,
"template": "iol",
"type": "iol",
"top": 435,
"url": "/html5/#/client/NTE5NTEAYwBteXNxbA==?token=XXX",
"config_list": [],
"config": "0",
"ethernet": 4,
"nvram": 1024,
"serial": 0
Eve-ng PRO: 2.0.4-77-PRO
OS: Ubuntu 16.04 LTS
Platform: Intel Xeon X5600
Thanks
Zbynek
API does not return console port number
Moderator: mike
-
- Posts: 533
- Joined: Wed Mar 15, 2017 1:54 pm
Re: API does not return console port number
console is not console port but protocol used to connect the device.
IOL ans Dynamips return a null value.
the url is the key used to describe ip/port to use.
In your sample you use a html5 console type session. In this context url return a http type console.
If you want to use API for script, use a native type session.
sample:
E.
IOL ans Dynamips return a null value.
the url is the key used to describe ip/port to use.
In your sample you use a html5 console type session. In this context url return a http type console.
If you want to use API for script, use a native type session.
sample:
Code: Select all
curl -k -s -b /tmp/cookie -c /tmp/cookie -X POST -d '{"username":"admin","password":"eve","html5":"-1"}' https://127.0.0.1/api/auth/login
{"code":200
"status":"success"
"message":"User logged in (90013)."}
curl -k -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' https://127.0.0.1/api/labs/Complex%20LAB%20Security%20perimeter2.unl/nodes/6?_=1541894234716 | sed -e 's/,/\n/g'
{"code":200
"status":"success"
"message":"Successfully listed node (60025)."
"data":{"console":""
"config":"0"
"delay":0
"left":313
"icon":"Switch L3.png"
"image":"i86bi_linux_l2-ipbasek9-ms.high_iron_aug9_2017b.bin"
"name":"SW-Corp"
"status":2
"template":"iol"
"type":"iol"
"top":489
"url":"telnet:\/\/127.0.0.1:34275"
"ethernet":3
"nvram":1024
"ram":1024
"serial":0}}
-
- Posts: 6
- Joined: Fri Nov 09, 2018 1:36 pm
Re: API does not return console port number
OK, got it. Works like a charm.
Thanks a lot for your help.
Zbynek
Thanks a lot for your help.
Zbynek
-
- Posts: 4
- Joined: Mon Jun 10, 2019 6:52 pm
Re: API does not return console port number
Would be great if the API How-to at https://www.eve-ng.net/documentation/ho ... eve-ng-api could be updated. I also wanted to get the telnet port number out and was getting the /html5 URL instead of telnet. I didn’t know about the “html5”:”-1” option at the API login.
Anyway, it’s working for me too now so I’m very happy
Anyway, it’s working for me too now so I’m very happy