Skip to content
Intrpt edited this page Apr 28, 2024 · 13 revisions

API Documentation

API Endpoints

Game Endpoints

Upload game

POST /games/
Parameters
name type data type description
Request Body

Request body is a file

Responses
http code content-type response header response body
201 text/plain;charset=UTF-8 content-location: /games/{uuid}
400 application/json {"message":"{reason}"}
405 application/json {"message":"Method not allowed"}
409 application/json {"message":"Game is already existing"}
500 application/json {"message":"{reason}"}
504 application/json {"message":"Kubernetes Control Server not reachable"}
Example cURL

curl --location 'http://localhost:8080/games/' --form 'file=@"Downloads/Awakening.nes"'


Get all uploaded games

GET /games/
Parameters
name type data type description
Responses
http code content-type response header response body
200 application/json "games:"[{"id": "5f31ba81-d41c-4b9c-ab1c-c90ceb07e5a3","title": "Mock1","status": "installed","url": "https://localhost:4200"},{"id": "92db29ed-54bb-4f40-aa03-2edca26974c6","title": "Mock2","status": "installed","url": "https://localhost:4200"}]
405 text/html;charset=utf-8 {"message":"Method not allowed"}
500 application/json {"message":"Internal Server Error"}
504 application/json {"message":"Kubernetes Control Server not reachable"}
Example cURL

curl --location 'http://localhost:8080/games/'


Get a specific game

GET /games/{id}/
Parameters
name type data type description
id required string uuid of the game
Responses
http code content-type response header response body
200 application/json {"id": "5abbf73d-f1bd-4fa5-8c38-5348a23ed465","title": "Mock","status": "installed","url": "https://localhost:4200"}
405 application/json {"message":"Method not allowed"}
404 application/json {"message":"Game not found"}
500 application/json {"message":"{reason}"}
504 application/json {"message":"Kubernetes Control Server not reachable"}
Example cURL

curl --location 'http://localhost:8080/games/5abbf73d-f1bd-4fa5-8c38-5348a23ed465'


Delete a game

DELETE /games/{id}/
Parameters
name type data type description
id required string uuid of the game
Responses
http code content-type response header response body
204 text/html;charset=utf-8
405 application/json "message":"Method not allowed"}
404 application/json {"message":"Game not found"}
500 application/json {"message":"{reason}"}
504 application/json {"message":"Kubernetes Control Server not reachable"}
Example cURL

curl --location --request DELETE 'http://localhost:8080/games/5abbf73d-f1bd-4fa5-8c38-5348a23ed465'


Clone this wiki locally