Configure file-popularity mechanism in the space.
Configures the file-popularity mechanism in the space. The mechanism is responsible for collecting file-popularity usage statistics per space support. Creates a view which can be queried to fetch the least popular files. The view is sorted in an increasing order by the popularity function value. The popularity function is defined as
P(lastOpenHour, avgOpenCountPerDay) = w1 * lastOpenHour + w2 * min(avgOpenCountPerDay, MAX_AVG_OPEN_COUNT_PER_DAY)
where:
* lastOpenHour - parameter which is equal to timestamp (in hours since 01.01.1970) of last open operation on given file
* w1 - weight of lastOpenHour parameter
* avgOpenCountPerDay - parameter equal to moving average of number of open operations on given file per day. Value is calculated over last 30 days.
* w2 - weight of avgOpenCountPerDay parameter
* MAX_AVG_OPEN_COUNT_PER_DAY - upper boundary for avgOpenCountPerDay parameter
Path parameters
| Parameter | Type & Description |
|---|---|
| id required | string The Id of a space. |
Request body
Configuration of the file-popularity mechanism in the space.
| Property | Type & Description |
|---|---|
enabled boolean If true, collecting file-popularity mechanism in the space is enabled. | |
exampleQuery string Example | |
lastOpenHourWeight number Weight of | |
avgOpenCountPerDayWeight number Weight of | |
maxAvgOpenCountPerDay number Maximal value of average open count per day taken to calculate the value of popularity function. | |
Request Examples
{
"enabled": true,
"exampleQuery": "curl -sS -k -H 'X-Auth-Token: $TOKEN' -X GET https://$HOST/api/v3/oneprovider/spaces/example_space_id/views/file-popularity?limit=10&stale=false",
"lastOpenHourWeight": 1,
"avgOpenCountPerDayWeight": 20,
"maxAvgOpenCountPerDay": 100
}Responses
Invalid request.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Unauthorized request.
Forbidden request.
Internal server error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}