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

Account alias and instance name should not be Null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • 2024-Oct-04
    • None
    • None
    • None

      In case that EC2 item doesn't have associated account-alias and/or instance_name, the api should return account / resource_id instead of Null.

      Example of current response :

      http://localhost:8000/api/cost-management/v1/reports/aws/resources/ec2-compute/

       

      "resource_id": "i-8598251265",
       "values": [
                     {
                         "resource_id": "i-8598251265",
                         "date": "2024-08",
                         "usage": {
                                      "value": 611.0,
                                      "units": "Hrs"
                                  },
                         "source_uuid": ["e2944339-7c57-4d06-9357-1e13c649f77c"],
                         "account_alias": null,
                         "account": "9999999999999",
                         "instance_name": null,

      When Nulls are return, UI displays only second line (shaded, smaller letters), which is inconsistent with AWS details pages and can look like a bug

       

      Also we have to make sure that this account_alias - account / instance_name - resource_id "inheritance" works with order-by param. Currently, if the values are missing, it returns No-account_alias / No-instnace_name which looks weird in UI.

      http://localhost:8000/api/cost-management/v1/reports/aws/resources/ec2-compute/?order_by[instance_name]=asc

      "resource_id": "i-8598251265",
                          "values": [
                              {
                                  "resource_id": "i-8598251265",
                                  "date": "2024-08",
                                  "usage": {
                                      "value": 611.0,
                                      "units": "Hrs"
                                  },
                                  "source_uuid": [
                                      "e2944339-7c57-4d06-9357-1e13c649f77c"
                                  ],
                                  "account_alias": null,
                                  "account": "9999999999999",
                                  "instance_name": "No-instance_name",
      

       

      http://localhost:8000/api/cost-management/v1/reports/aws/resources/ec2-compute/?order_by[account_alias]=asc

      "resource_id": "i-8598251265",
                          "values": [
                              {
                                  "resource_id": "i-8598251265",
                                  "date": "2024-08",
                                  "usage": {
                                      "value": 611.0,
                                      "units": "Hrs"
                                  },
                                  "source_uuid": [
                                      "e2944339-7c57-4d06-9357-1e13c649f77c"
                                  ],
                                  "account_alias": "No-account_alias",
                                  "account": "9999999999999",
                                  "instance_name": null, 

       

              rh-ee-lbacciot Lucas Bacciotti
              rhn-support-esebesto Eva Šebestová
              Eva Šebestová Eva Šebestová
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: