Move snapshot age conversion to client and round

Moves the age human conversion logic to the client so that this value
can be used by API consumers programatically.

Rounding ensures recent snapshots are not showing as "older" than they
actually are, which is important for accuracy especially with
automirror snapshots and ages above half the next rounding value.
This commit is contained in:
2024-11-16 13:31:56 -05:00
parent 08227ba0f4
commit d7f40ba1aa
4 changed files with 42 additions and 28 deletions

View File

@ -1783,7 +1783,7 @@ class API_VM_Root(Resource):
description: Unix timestamp of the snapshot
age:
type: string
description: Human-readable age of the snapshot in the largest viable unit (seconds, minutes, hours, days)
description: Age of the snapshot in seconds
rbd_snapshots:
type: array
items: