Anubis icon indicating copy to clipboard operation
Anubis copied to clipboard

ADD button to superuser.users page for deleting pvcs

Open wabscale opened this issue 3 years ago • 0 comments

This one is a two parter. There is a small backend component, and a small frontend component.

Backend

Deleting a user's PVC is already a defined function in anubis.k8s.pvc.reap.reap_user_pvc. The thing is that you cant call this directly. You call the anubis.rpc.enqueue.enqueue_reap_pvc_user. You'll need to add a flask endpoint in anubis.views.super.students to handle taking a student id, and calling the enqueue function.

Make the endpoint /super/students/pvc/<string:user_id>. Make the endpoint also a delete, not a get method (Just @students_.delete instead of @students_.route)

You can model your endpoint after either of the toggle functions in that file.

Frontend

The frontend bit is a bit easier. Just add a button to the superuser users page for calling the endpoint. If you cant do this, just leave it and I'll do it.

wabscale avatar Sep 27 '22 00:09 wabscale