October-14th-2020, 01:30 PM
Hi all,
we need the MAC address of the host system inside a container on the Hilscher netPI.
For me it seemed to be a suitable solution to get the LAN settings, and also the MAC, from the Hilscher REST API.
As described in this thread, we first logged in with the admin user to get the authentication cookie.
With the authentication cookie we are able to get various information from the API. The following requests all worked.
But the request to get the LAN settings always responds the following:
Here's the request as we tried:
The admin user has all read & write rights in the application, also for the REST API.
Can anyone imagine what we are doing wrong here?
Is this a good way to get the MAC-address of the host system or is there a better solution?
Many thanks in advance.
Best regards
Benjamin
we need the MAC address of the host system inside a container on the Hilscher netPI.
For me it seemed to be a suitable solution to get the LAN settings, and also the MAC, from the Hilscher REST API.
As described in this thread, we first logged in with the admin user to get the authentication cookie.
Code:
curl -L -k -X POST 'https://<HOST-IP>/login' -H 'Content-Type: application/json' -d '{"username":"admin","password":"<PASSWORD>"}'
With the authentication cookie we are able to get various information from the API. The following requests all worked.
Code:
curl -L -k -X GET 'htps://<HOST-IP>/?page=infocenter' -H 'Cookie: <COOKIE>'
Code:
curl -L -k -X GET 'htps://<HOST-IP>/get/devicestatus/getCPUStatus' -H 'Cookie: <COOKIE>'
Code:
curl -L -k -X POST 'https://<HOST-IP>/system' --header 'Cookie: <COOKIE>; Content-Type: application/x-www-form-urlencoded' -d "argument=reboot"
But the request to get the LAN settings always responds the following:
Code:
{"status":"Failed","message":"Permission denied"}
Here's the request as we tried:
Code:
curl -L -k -X GET 'htps://<HOST-IP>/get/networksettings/lansettings' -H 'Cookie: <COOKIE>'
The admin user has all read & write rights in the application, also for the REST API.
Can anyone imagine what we are doing wrong here?
Is this a good way to get the MAC-address of the host system or is there a better solution?
Many thanks in advance.
Best regards
Benjamin