File: summary_parameters.yml

package info (click to toggle)
cloudkitty 23.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,528 kB
  • sloc: python: 21,803; sh: 528; makefile: 226; pascal: 54
file content (143 lines) | stat: -rw-r--r-- 5,095 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
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. These filters accept multiple query parameters. To use
    this option with multiple parameters, repeat it as many time as desired in
    the query string. For instance, to restrict the result to only two
    projects, add to the query string
    ``filters=project_id:<project_id_one>&filters=project_id:<project_id_two>``.
    Bear in mind that this string must be URL escaped. Therefore, it becomes
    ``filters=project_id%3A<project_id_one>&filters=project_id%3A<project_id_two>``.
  type: dict
  required: false

groupby:
  in: query
  description: |
    Optional attributes to group the summary by. The ``groupby`` elements are
    defined in the collector YML settings. Therefore, one can group the
    result using any of the ``groupby`` attributes defined in the collector
    settings of CloudKitty. Besides those attributes, by default, starting
    in CloudKitty ``2024.1`` release, we will have the following new groupby
    options: (i) time: to group data hourly; (ii) time-d: to group data
    by day of the year; (iii) time-w: to group data by week of the year;
    (iv) time-m: to group data by month; and, (v) time-y: to group data by
    year. If you have old data in CloudKitty and you wish to use these
    group by methods, you will need to reprocess the desired timeframe.
    The `groupby` options ``time-d``, ``time-w``, ``time-m``, ``time-y`` are the
    short versions of the following `groupby` options ``day_of_the_year``,
    ``week_of_the_year``, ``month``, and ``year`` respectively.
  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

response_format:
  in: query
  description: |
    Optional attribute to define the object structure used in the response.
    Both responses will be JSON objects. Possible values are ``table`` or
    ``object``.

    The default value is ``table`` object structure, where one has the
    attributes `total`, which indicates the total number of entries in the
    response; `results`, which is a list of lists, where the nested list
    contains the values of each entry; and, `columns`, which is the attribute
    that describes all of the available columns. Then, each index in this
    list (`columns`) corresponds to the metadata of the values in the `results`
    list.

    The structure for the `object` option uses a dictionary. The response still
    has the `total` attribute. However, in the `results` attribute, one will
    find a list of objects, instead of a list of lists of values that we see
    in the `table` option. This facilitates the processing of some use cases.
  type: string
  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