ethereum/hive

Simulator API Cleanup

fjl opened this issue · 1 comments

fjl commented

The HTTP API for simulators is a bit messy because it mixes content types application/x-www-form-urlencoded, application/json, multipart/form-data and text/plain. It would be nice to agree on just one style.

I want to change it as follows:

  • All responses should have type application/json. In case of error, the response should be {"error": "text"}.
  • Suite & test case creation requests should take JSON like {"name": "...", "description": "..."} and return a JSON integer ID like 14.
  • Test case end request input should be changed to JSON like {"pass": true, "details": "..."}.
  • The client start request has a multipart/form-data body encoding and uses form parameters to specify client type and other launch parameters. It is also possible to pass files to the client. It's OK for this endpoint to continue accepting multipart/form-data, but instead of sending HIVE_ environment variables and other configuration as form parameters, the launch config should be sent as a JSON object like {"environment": {...}, "networks": [...]}.
  • The response of client start requests should be {"id": "...", "ip": "..."}. There is no longer any need to return the MAC address.
  • The response format of the container IP request should be JSON like "172.16.1.3".
fjl commented

These changes were implemented in 869ed8d...6c6d996