Each action made by a user is historized in a time series data base. The retention time is set to 53 weeks.
To get this usage, the resqueter has the possibility to use the GET /user/{uuid}
endpoint and set the usage
parameter to true
. The api will return the usage of the api resources since 30 days.
example of usage:
"usage": {
"resource.user.list": 1,
"resource.user.read": 4
}
Instead of setting usage
parameter to true
, a duration could be passed (like 10d : for 10 days). Then the response will take into account the usage of the user during this period. The duration value can be expressed with units. The available units are:
With these responses, the requester can only retreive the aggregated usage during the last period. By specifying a start time
, an end time
and an aggregation period
, the requester could retreive the corresponding time serie for each resource. These 3 values should be passed to the usage parameter seperated by ";".
Example :
'2020-10-01T00:00:00Z';'2020-10-22T00:00:00Z';1d
When an exact time is specified, use quotes to surround the value.
Exemple :
now()-1d;now();1d
You can use the now()
function to specified the current time and you can use + or - to add ou substract a duration.
the result looks like:
"usage_stat": {
"resource.user.list": [
{
"time": "2020-10-20T00:00:00Z",
"n": 0
},
{
"time": "2020-10-21T00:00:00Z",
"n": 1
}
],
"resource.user.read": [
{
"time": "2020-10-20T00:00:00Z",
"n": 0
},
{
"time": "2020-10-21T00:00:00Z",
"n": 18
}
]
}
The owned items can be requested along with the user information. For this use, the user get info has a dedicated parameter count
(set at false by default). When set to true
, the result will contain a section like :
"count": {
"blob": 0,
"acl": 0,
"securityGroup": 1,
"cluster": 0,
"avatar": 600
}