cloudkitty/releasenotes/notes/response_format-v2-summary-api-270facdb01d9202b.yaml
Rafael Weingärtner 6ba9d45ea6 Introduce "response_format" for the V2 summary API
The V2 summary endpoint uses a quite unconventional data format in
the response. Currently, the format is the following:

```
{"total": <number of elements in the response>,
 "results": [array of arrays of data],
 "columns": [array of columns]}
```

To process this, we need to find the index of a column in the column
list, and with this index, we retrieve the data in the array of data
that is found in the array of results. The proposal is to use the
following format in the response.

```
{"total": <number of elements in the response>,
 "results": [array of objects/dictionary]}
```

With this new format, one does not need to consult the index of a
column to retrieve data in one of the entries. We would only need to
retrieve the data in the entry using its column name. Therefore, the
coding feels more natural. To maintain compatibility, this new format
would be only applied when an option is sent to CloudKitty via
`response_format` option.

Depends-on: https://review.opendev.org/c/openstack/cloudkitty/+/793973

Change-Id: I5869d527e6e4655c653b6852d6fb7bebc9d71520
2021-12-02 12:56:37 +00:00

5 lines
131 B
YAML

---
features:
- |
Introduce ``response_format`` option for the V2 summary API, which can
facilitate parsing the response.