Skip to content

Conversation

@skl1017
Copy link
Collaborator

@skl1017 skl1017 commented Nov 13, 2025

🚀 Implemented Endpoints (Vms)

  • **GET** /: Retrieve the complete list of all available VMs. (Status: 200 OK)
    
  • **GET** /{vm_id}: Retrieve the full details of a specific VM. (Status: 200 OK)
    
  • **GET** /{vm_id}/state: Retrieve the current running state (e.g., Running, Stopped) of the VM. (Status: 200 OK) 
    
  • **POST** /: Create a new VM. Requires the VmCreate schema in the request body. (Status: 201 Created)
    
  • **POST** /{vm_id}/start: Initiate the start process for the specified VM. (Status: 200 OK)
    
  • **POST** /{vm_id}/stop: Initiate the stop/shutdown process for the specified VM. (Status: 200 OK)
    
  • **PUT** /{vm_id}/password: Generate and set a new password hash for the VM. (Status: 200 OK)
    

skl1017 and others added 30 commits October 23, 2025 11:15
…onfiguration and user login, still need to figure out why the created vm is not booting when using a qcow2 image
…ear_vm.sh in order to make a distribox image out of an ubuntu cloud image, the final distribox image
…ke a persistant connection with libvirt socket
…changing state, changed the status name to state for more clarity and coherence
@skl1017 skl1017 requested a review from lg-epitech November 13, 2025 12:00
Copy link
Collaborator

@lg-epitech lg-epitech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve this is great job. Just a few notes for next time.

  • Make sure the application code and messages you return are in English, I want the app to be exclusively English. I caught a french sentence in the VM_STATE_NAMES in the middle of other English statuses.
  • I would like you to take a look at the PEP8 convention for python syntax and try to implement as much of it as you can. You can also look into code formatters such as autopep8 which from my recollection aren't that great, and I don't want you to take everything it gives as truth, but it's a great start to learn the conventions.

Otherwise great job.
Next features we will need that I noted were missing are:

  • We need an endpoint to remove a vm from it's id
  • We need an endpoint to remove the credentials assigned to a vm, also make sure the current endpoint /:vmid/password does override the current credentials if others exist.
  • I will need pagination for the get_vm_list. I like verbose pagination, here is inspiration, where you create a pagination object in your json response.
GET /vms?page=2&limit=10
{
  "data": [/* List of the vms of the current page */],
  "pagination": {
    "page": 2,
    "limit": 10,
    "total_items": 16,
    "total_pages": 2,
  }
}
  • In the future we will look at other endpoints to duplicate a vm or take snapshots but this is not priority

@lg-epitech lg-epitech merged commit 6c2a0bf into main Nov 13, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants