mirror of
https://github.com/ThunixdotNet/thunix_api.git
synced 2026-01-24 13:10:18 +00:00
Finished memory endpoint
This commit is contained in:
@@ -5,4 +5,11 @@ class Memory(Resource):
|
||||
def get(self):
|
||||
vmem_usage = psutil.virtual_memory()
|
||||
smem_usage = psutil.swap_memory()
|
||||
abort(501, message="Not currently implemented.")
|
||||
json_payload={
|
||||
"total":vmem_usage.total,
|
||||
"free":vmem_usage.free,
|
||||
"used":vmem_usage.used,
|
||||
"percent":vmem_usage.percent
|
||||
}
|
||||
#abort(501, message="Not currently implemented.")
|
||||
return json_payload
|
||||
|
||||
Reference in New Issue
Block a user