implement deleting capsuls

This commit is contained in:
2020-05-15 12:23:42 -05:00
parent 8e8705da7b
commit 0434c4d43b
7 changed files with 190 additions and 119 deletions

@ -90,7 +90,7 @@ class DBModel:
self.cursor.fetchall()
))
def updateVm(self, email, id, ipv4):
def update_vm_ip(self, email, id, ipv4):
self.cursor.execute("UPDATE vms SET last_seen_ipv4 = %s WHERE email = %s AND id = %s", (ipv4, email, id))
self.connection.commit()
@ -111,9 +111,9 @@ class DBModel:
)
self.connection.commit()
# def vm_exists(self, email, id):
# self.cursor.execute("SELECT id FROM vms WHERE email = %s AND id = %s ", (email, id))
# return len(self.cursor.fetchall()) > 0
def delete_vm(self, email, id):
self.cursor.execute("UPDATE vms SET deleted = now() WHERE email = %s AND id = %s", ( email, id))
self.connection.commit()
def get_vm_detail(self, email, id):
self.cursor.execute("""