You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nexus: Remove TimeseriesKey from timeseries output (#8842)
Our external API timeseries endpoints currently return data as a
`BTreeMap<TimeseriesKey, Timeseries>`, which results in JSON output with
arbitrary numeric keys that have no meaning to API consumers:
```json
{
"timeseries": {
"2352746367989923131": { ... },
"3940108470521992408": { ... }
}
}
```
This commit introduces a new `TableOutput` struct that presents
timeseries data as an array instead of a map. The `TableOutput` type is
converted from the internal `Table` representation at the API boundary,
preserving the ordering from the original `BTreeMap` while providing a
cleaner JSON structure:
```json
{
"timeseries": [ { ... }, { ... } ]
}
```
Closes#8108
---------
Co-authored-by: David Crespo <[email protected]>
Copy file name to clipboardExpand all lines: openapi/nexus.json
+22-20Lines changed: 22 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -22275,14 +22275,35 @@
22275
22275
"description": "Tables resulting from the query, each containing timeseries.",
22276
22276
"type": "array",
22277
22277
"items": {
22278
-
"$ref": "#/components/schemas/Table"
22278
+
"$ref": "#/components/schemas/OxqlTable"
22279
22279
}
22280
22280
}
22281
22281
},
22282
22282
"required": [
22283
22283
"tables"
22284
22284
]
22285
22285
},
22286
+
"OxqlTable": {
22287
+
"description": "A table represents one or more timeseries with the same schema.\n\nA table is the result of an OxQL query. It contains a name, usually the name of the timeseries schema from which the data is derived, and any number of timeseries, which contain the actual data.",
22288
+
"type": "object",
22289
+
"properties": {
22290
+
"name": {
22291
+
"description": "The name of the table.",
22292
+
"type": "string"
22293
+
},
22294
+
"timeseries": {
22295
+
"description": "The set of timeseries in the table, ordered by key.",
22296
+
"type": "array",
22297
+
"items": {
22298
+
"$ref": "#/components/schemas/Timeseries"
22299
+
}
22300
+
}
22301
+
},
22302
+
"required": [
22303
+
"name",
22304
+
"timeseries"
22305
+
]
22306
+
},
22286
22307
"Password": {
22287
22308
"title": "A password used to authenticate a user",
22288
22309
"description": "Passwords may be subject to additional constraints.",
@@ -25523,25 +25544,6 @@
25523
25544
"vlan_id"
25524
25545
]
25525
25546
},
25526
-
"Table": {
25527
-
"description": "A table represents one or more timeseries with the same schema.\n\nA table is the result of an OxQL query. It contains a name, usually the name of the timeseries schema from which the data is derived, and any number of timeseries, which contain the actual data.",
25528
-
"type": "object",
25529
-
"properties": {
25530
-
"name": {
25531
-
"type": "string"
25532
-
},
25533
-
"timeseries": {
25534
-
"type": "object",
25535
-
"additionalProperties": {
25536
-
"$ref": "#/components/schemas/Timeseries"
25537
-
}
25538
-
}
25539
-
},
25540
-
"required": [
25541
-
"name",
25542
-
"timeseries"
25543
-
]
25544
-
},
25545
25547
"TargetRelease": {
25546
25548
"description": "View of a system software target release.",
0 commit comments