Flask web service for handling virtual machines (VirtualBox ) - Stand Alone Version and Inside a VirtualBox Inside a Docker container (Dockerized Version)
git clone https://github.com/AndresHerrera/Proyecto-GestionVMWebservices.git
https://asciinema.org/a/RqNmrWZLqCgRKCx25mPD39Q8K
$python install.sh
** Using this Docker container : https://hub.docker.com/r/blacklabelops/virtualbox/
$docker pull blacklabelops/virtualbox
$docker build -t wsinsidedocker:latest .
$python prj-vmwebservice.py
$ curl -i http://localhost:5000/
METHOD | URL | JSON Response |
---|---|---|
GENERAL | ||
GET | curl http://localhost:5000/ | Avaliable services |
GET | curl http://localhost:5000/vms/ostypes | List OS types supported for Virtual Box |
GET | curl http://localhost:5000/vms | List VMS |
GET | curl http://localhost:5000/vms/running | Running VMS |
GET | curl http://localhost:5000/vms/info/vmname | Info for vmname VM |
POST | curl -i -H "Content-Type: application/json" -X POST -d '{"name":"osweb", "disksize":"32738", "cpunumber":"4" , "memory":"1024" , "ram":"580"}' http://localhost:5000/vms | Create a VM. |
DELETE | curl -i -H "Content-Type: application/json" -X DELETE http://localhost:5000/vms/vmname | Delete a VM (vmname). |