DMTF / Redfish-Interface-Emulator

The Redfish Interface Emulator can emulate a Redfish-based interface statically (GET) or dynamically (POST, PATCH, DELETE)
Other
65 stars 25 forks source link

curl POST request getting a 404 not found return from emulator.py #110

Open jimlundberg opened 2 years ago

jimlundberg commented 2 years ago

Both my IBM CentOS server and my local wsl CentOS image are both getting a 404 return on a POST request. It is happening with both http and https requests. I would think the problem may be in the flask module or maybe requests.

Client side:

(venv) [root@IBM-R912JTS2 emulator]# curl -X POST -k -H 'Content-Type: application/json' https://9.114.207.147:5000/redfish/v1/SessionService/Sessions -d '{"UserName":"Admin"}' curl: (7) Failed to connect to 9.114.207.147 port 5000: Connection refused (venv) [root@IBM-R912JTS2 emulator]# clear (venv) [root@IBM-R912JTS2 emulator]# curl -X POST -k -H 'Content-Type: application/json' https://172.24.225.83:5000/redfish/v1/SessionService/Sessions -d '{"UserName":"Admin"}' ""(venv) [root@IBM-R912JTS2 emulator]# curl -X GET -H 'Content-Type: application/json' https://172.24.225.83:5000/redfish/v1/ curl: (60) SSL certificate problem: self signed certificate More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above. (venv) [root@IBM-R912JTS2 emulator]# curl -k -X GET -H 'Content-Type: application/json' https://172.24.225.83:5000/redfish/v1/ { "@odata.context": "/redfish/v1/$metadata#ServiceRoot", "@odata.type": "#ServiceRoot.1.0.0.ServiceRoot", "@odata.id": "/redfish/v1/", ....

Server side:

(venv) [root@IBM-R912JTS2 emulator]# python3 emulator.py /mnt/c/Users/C-VS95897/venv/lib64/python3.6/site-packages/requests/init.py:104: RequestsDependencyWarning: urllib3 (1.26.9) or chardet (5.0.0)/charset_normalizer (2.0.12) doesn't match a supported version! RequestsDependencyWarning) INFO:root:Mockup folders ['Redfish']

jcleung5549 commented 2 years ago

The SessionService resource is not fully implemented in this emulator. Hence there are stubs in the resource API file - ./api_emulator/redfish/SessionService_api.py

Fortunately, the SNIA API Emulator (https://github.com/SNIA/Swordfish-API-Emulator) is working to fix this.