Uploaded image for project: 'Cost Management'
  1. Cost Management
  2. COST-659

Update tag rate serializer to only allow one metric per cost type.

XMLWordPrintable

    • COST Sprint 58

      We need to update the serializer for the tag rates to only allow one metric per cost type. 

      For example,

       ```
      {
      "metric":

      { "name": "node_cost_per_month", "label_metric": "Node", "label_measurement": "Currency", "label_measurement_unit": "node-month" }

      ,
      "description": "",
      "tag_rates": [
      {
      "tag_key": "app",
      "tag_values": [
      {
      "unit": "USD",
      "usage":

      { "unit": "USD", "usage_end": null, "usage_start": null }

      ,
      "value": 24000.0,
      "default": true,
      "tag_value": "smoking",
      "description": ""
      }
      ]
      }
      ],
      "cost_type": "Infrastructure"
      },
      {
      "metric":

      { "name": "node_cost_per_month", "label_metric": "Node", "label_measurement": "Currency", "label_measurement_unit": "node-month" }

      ```
       

       

      If the cost_type of the second "node_cost_per_month" is infrastructure then the cost model should be rejected; however, if it is supplementary, then it should be allowed.

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

                Created:
                Updated: