fix: use AVERAGE instead of average for PBS RRD API cf parameter

Fixes #483 - PBS syslog was being flooded with 400 Bad Request errors
because the cf parameter value 'average' is not in the valid enumeration.
Changed to 'AVERAGE' (all caps) per PBS API specification.
This commit is contained in:
rcourtman
2025-10-01 11:04:30 +00:00
parent c664204b59
commit d88cce2cfc
+2 -1
View File
@@ -475,7 +475,8 @@ func (c *Client) GetDatastores(ctx context.Context) ([]Datastore, error) {
for _, ds := range datastoreList.Data {
// Try to get RRD data first which has more statistics
// RRD requires cf (consolidation function) and timeframe parameters
rrdPath := fmt.Sprintf("/admin/datastore/%s/rrd?cf=average&timeframe=hour", ds.Store)
// Valid cf values: AVERAGE, MAXIMUM, MINIMUM (all caps per PBS API spec)
rrdPath := fmt.Sprintf("/admin/datastore/%s/rrd?cf=AVERAGE&timeframe=hour", ds.Store)
rrdResp, err := c.get(ctx, rrdPath)
var dedupFactor float64
if err == nil {