Uploaded image for project: 'Cost Management'
  1. Cost Management
  2. COST-3592 Mapping existing tag keys to other existing tag keys, one by one
  3. COST-4810

API Update: Modify serializer to only allow certain order by options

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: Undefined Undefined
    • March 2024, 2024Q1
    • None
    • None
    • None
    • 1
    • False
    • None
    • False
    • COST-574 - Tag reconciliation

      We used a default model serializer which allows us to order by all the options in the model. However, `order_by[parent]` on the `/parent` endpoint will return a row for every time the key is used in the tag mapping model. 

      This creates duplicates rows for the same key associated with the same uuid. This issue is to harden our serializer to only allow order by options that produce the expected behaviors.

      Example URL:
      http://localhost:8000/api/cost-management/v1/settings/tags/mappings/parent/?limit=10&order_by[parent]=asc&offset=0

      Example Return:
       

      "data": [ 
      { "uuid":"9c6dfdb0-f8cd-4b62-b8db-71f160ec86f2", "key":"application", "source_type":"OCP", "cost_model_id":"ef84b2f5-4432-4fd5-bcc3-46e74b926e9d" }, 
      { "uuid":"9c6dfdb0-f8cd-4b62-b8db-71f160ec86f2", "key":"application", "source_type":"OCP", "cost_model_id":"ef84b2f5-4432-4fd5-bcc3-46e74b926e9d" }]}

      ^ Notice how the uuid is the same

              myersco Cody Myers
              myersco Cody Myers
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: