On Tue, 16 Apr 2019 12:26:37 -0700, Dan Smith <dms@danplanet.com> wrote:
When a /usages query is made, the consumer type could be optionally expressed, limiting results. Are multiple types something that needs to be expressed in one query? Not yet discussed.
I expect that Nova's quota stuff will want to be able to express multiples, FWIW. However, I think I can say for sure that the usage result will be the most useful for quota behavior if it returns usages grouped by type (whether or not a subset of types were in a filter query).
Yes, would be helpful to be able to get multiple consumer types in a single query. I agree that we would need to be able to sort through the different consumer types on the response side. For example, we'll want to be able to count quota usage as max('instance' usage, 'migration' usage) during a resize. And if a multiple consumer types filtered query returned a roll-up of all usages without grouping by consumer type, we would not be able to do the max thing we want to do without multiple separate queries to placement. Note that this reminds me that today we have to do two separate queries to placement, one filtered by project_id and one filtered by project_id and user_id in order to roll-up usage for a project and usage for a project user, for similar reasons. -melanie