1. 12 Aug, 2022 1 commit
    • Pierre Riteau's avatar
      Add MAP mutator · c9340b35
      Pierre Riteau authored
      This mutator can map arbitrary values to new values. This is useful with
      metrics reporting resource status as their value, but multiple statuses
      are billable.
      
      Change-Id: I8fcb9f2aa4ef23432089bfd6351a9c03ce3cf941
      c9340b35
  2. 08 Aug, 2022 1 commit
  3. 08 Jul, 2022 1 commit
  4. 26 Jun, 2022 1 commit
    • Takashi Kajinami's avatar
      Replace deprecated assertRaisesRegexp · 788970e2
      Takashi Kajinami authored
      It was deprecated in favor of assertRaisesRegex added in Python 3.2.
      We can replace it now because Python 2 is no longer supported.
      
      Change-Id: I4cec6e44d48bcee9808bfd647f3a45cd8b1e2f11
      788970e2
  5. 13 Jun, 2022 3 commits
  6. 03 Jun, 2022 1 commit
    • Rafael Weingärtner's avatar
      Add API to create scopes · 3a262348
      Rafael Weingärtner authored
      This commit adds an API enabling the POST operation to create scopes in
      an ad hoc fashion. This is useful for operators to register scopes
      before they are created as resources in the collected backend so their
      processing can be discarded right away, for example for trial
      projects/accounts.
      
      Otherwise, we need to wait for them to create resources, then for
      example Ceilometer has to monitor these resources, persist measures in
      Gnocchi, then CloudKitty has to discover the scopes and finally we can
      disable their processing.
      
      Change-Id: I3e947d36c9d5d5da07115d35dde578ae300cbe5c
      3a262348
  7. 01 Jun, 2022 6 commits
  8. 31 May, 2022 1 commit
    • Pierre Riteau's avatar
      Fix incorrect use of voluptuous.Coerce · 85da7290
      Pierre Riteau authored
      The voluptuous.Coerce validator expects a type, not a function. Use
      tzutils.dt_from_iso directly instead, since voluptuous.Schema accepts
      callables.
      
      Change-Id: Ibe01ac289f00f24fa35ad2416fa2a93d8d6f57a6
      Story: 2010058
      Task: 45502
      85da7290
  9. 21 Mar, 2022 1 commit
  10. 10 Mar, 2022 1 commit
  11. 08 Mar, 2022 2 commits
  12. 25 Feb, 2022 3 commits
  13. 22 Feb, 2022 1 commit
    • Pierre Riteau's avatar
      Raise CollectError when Prometheus query returns an error · a5368804
      Pierre Riteau authored
      As described in the Prometheus HTTP API documentation [1], the JSON
      response to a Prometheus query includes a status field, which was
      ignored by CloudKitty. If it is set to "error", raise a CollectError
      exception to log the error type and details.
      
      For example, a query with a metric name containing a dot will produce
      the following error:
      
          cloudkitty.collector.exceptions.CollectError: bad_data: invalid parameter "query": 1:25: parse error: unexpected character: '.'
      
      [1] https://prometheus.io/docs/prometheus/latest/querying/api/
      
      Change-Id: I0c2892a39ec50163de251b38d34493db6a22c858
      Story: 2009869
      Task: 44564
      a5368804
  14. 21 Feb, 2022 2 commits
  15. 18 Feb, 2022 1 commit
    • Takashi Kajinami's avatar
      Fix description of orchestrator parameters · 9d917cc1
      Takashi Kajinami authored
      - coordination_url is not driver URL but backend URL. Driver is
        determined according to the backend.
      
      - The parameter description should not use abbreviations, as these
        can confuse users.
      
      Change-Id: I16eb47e161ae826393d113082091c292d097fc03
      9d917cc1
  16. 07 Feb, 2022 1 commit
  17. 10 Jan, 2022 2 commits
  18. 28 Dec, 2021 1 commit
  19. 14 Dec, 2021 1 commit
  20. 13 Dec, 2021 5 commits
    • Zuul's avatar
      Merge "Fix quote API" · 0014fc50
      Zuul authored
      0014fc50
    • Zuul's avatar
      Merge "Adding two options in fetcher_keystone" · 76fcadcb
      Zuul authored
      76fcadcb
    • Zuul's avatar
      Merge "Add missing whitespace in log message" · a9355c8e
      Zuul authored
      a9355c8e
    • Rafael Weingärtner's avatar
      Fix quote API · 21a87304
      Rafael Weingärtner authored
      The quote API method has been broken for a while now. This patch fixes
      the API and makes it work again. To use it, one can issue the following
      command.
      
          curl -s -X POST "http://cloudkitty_server_and_port/v1/rating/quote" -H "Accept: application/json" -H "User-Agent: python-keystoneclient" -H "Content-Type: application/json" -H "X-Auth-Token: ${ACCESS_TOKEN_KEYSTONE}" -d '{"resources": [{"service": "<cloudkitty_service_name>", "volume": "<quantity_to_quote>", "desc": {"metadata": {"<field_name_used_to_define_price>": "<value_to_activate_a_price>"}}}]}'
      
      Change-Id: Ia6ef6543a5100445b203196d39b404bc74b75ba0
      Story: 2009022
      Task: 42744
      21a87304
    • Rafael Weingärtner's avatar
      Add support for multiple value filters · 76e98ffd
      Rafael Weingärtner authored
      The goal of this patch is to introduce support for multi-valued
      parameters. For instance, for the `type` parameter, even though the code
      was treating it as a possible list of types, the API would not allow a
      user to send multiple types.
      
      This patch enables users to send filters with multiple values, which can
      be useful for filtering by project_ids for instance, or different types
      (metric types).
      
      Change-Id: I59397b33d014709eb976c78d517f009b8a2be4cf
      76e98ffd
  21. 10 Dec, 2021 1 commit
  22. 02 Dec, 2021 1 commit
    • Rafael Weingärtner's avatar
      Introduce "response_format" for the V2 summary API · 6ba9d45e
      Rafael Weingärtner authored
      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
      6ba9d45e
  23. 29 Nov, 2021 2 commits
    • guest's avatar
      Adding two options in fetcher_keystone · 3c7f573c
      guest authored
      This patch adds two options in fetcher_keystone to filter which tenants
      should be rated:
      
      ignore_disabled_tenants (Default=False)
      ignore_rating_role (Default=False)
      
      In our case we currently have 2k projects (growing) and we want to rate
      all active projects, so checking the role rating is useless and consumes
      resources for nothing. Besides, cloudkitty rates projects regardless if
      there are enabled or disabled which is also useless and consumes
      resources in our case.
      
      Change-Id: I6479d76c367dc4217bce4de9c3db41c4612f0397
      3c7f573c
    • Zuul's avatar
      83e89239