Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-1934

[Spike] Investigate options to eliminate hard coded metricids in getInstancesByProduct API sorting key

XMLWordPrintable

      Currently when calling the getInstancesByProduct() api one of the options is to sort the results by a measurement. Unfortunately today, the specification of the sortable items is an enum in the API spec [1]. This is a problem because the enumeration has to be updated whenever a new sortable measurement type is added. The possible values for metric id for a given product are coming from configuration. This puts us in a weird place where half the values cleanly map to an enumeration and half of them are custom per product. 

      This card is to investigate what the options are and present a proposal so that we do not have to update an enumeration in an API spec every time we add a new metricid for a new product. 

       

      [1]https://github.com/RedHatInsights/rhsm-subscriptions/blob/d12cb4833954dda394fdee5dfe8a5e11da0f5dcc/api/rhsm-subscriptions-api-spec.yaml#L848 

              jcarvaja@redhat.com Jose Carvajal Hilario
              bcourt@redhat.com Barnaby Court
              Aurobinda Nayak Aurobinda Nayak
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: