cloudkitty/doc/source/api-reference/v2/summary/summary_parameters.yml

104 lines
2.6 KiB
YAML

begin: &begin
in: query
description: |
Begin of the period for which the summary is required.
type: iso8601 timestamp
required: false
custom_fields:
in: query
description: |
Optional attributes to customize the summary GET API response. When
using this parameter, users can create custom reports. The default
behavior is to list the sum of the quantity and the sum of the price,
which is projected as ``rate`` field. The default value for the
``custom_fields`` parameter is ``SUM(qty) AS qty, SUM(price) AS rate``.
One can customize this field as they wish with InfluxDB queries. The
following statements ``"select", "from", "drop", "delete", "create",
"alter", "insert", "update"`` are not allowed though. For instance, if
one wants to retrieve the quantity field as the last value of the
quantity, and not the sum (this is quite interesting when generating
reports for storage values), the user can send the parameter as ``last(qty)
AS qty, SUM(price) AS rate``. To discover all possible fields that one
can work with, the user can also use ``*`` as a parameter.
``Currently this feature only works for Influx storage backend.`` It
(the feature) depends on the storage backend driver to support it. If
the user tries to set this configuration while using other storage
backends, it will be ignored.
type: list of strings
required: false
end: &end
in: query
description: |
End of the period for which the summary is required.
type: iso8601 timestamp
required: false
filters:
in: query
description: |
Optional filters.
type: dict
required: false
groupby:
in: query
description: |
Optional attributes to group the summary by.
type: list of strings
required: false
limit:
in: query
description: |
For pagination. The maximum number of results to return.
type: int
required: false
offset: &offset
in: query
description: |
For pagination. The index of the first element that should be returned.
type: int
required: false
begin_resp:
<<: *begin
required: true
description: Begin of the period for the item.
in: body
end_resp:
<<: *end
required: true
description: End of the period for the item.
in: body
qty: &qty
in: body
description: |
Qty for the item.
type: float
required: true
qty_resp:
<<: *qty
required: true
description: Qty for the item in the specified period.
in: body
rate: &rate
in: body
description: |
Rate for the item.
type: float
required: true
rate_resp:
<<: *rate
required: true
description: Rate for the item in the specified period.
in: body