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

Use a common filter for filtering by resource_id and instance_name

XMLWordPrintable

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

      Currently, EC2 API supports filtering by resource_id and instance_name

      http://localhost:8000/api/cost-management/v1/reports/aws/resources/ec2-compute/?filter[resource_id]=some_resource_id
      
      http://localhost:8000/api/cost-management/v1/reports/aws/resources/ec2-compute/?filter[instance_name]=some_instance_name 

      But in UI, both resource_id and instance_name are collapsed into one column (the same way as account/account_alias) and there is only 1 common filter for them - "Instance"Consequently, filtering in UI doesn't work correctly because UI can use just 1 request, and has no way to know whether customer decided to use resource_id or instance_name.

      After discussing this in slack, we agreed that API behavior should be the same as in the case of account/account_alias:
      There should be just one common filter for both resource_id and instance_name:

      http://localhost:8000/api/cost-management/v1/reports/aws/resources/ec2-compute/?filter[filter_name]=some_resource_id
      
      http://localhost:8000/api/cost-management/v1/reports/aws/resources/ec2-compute/?filter[filter_name]=some_instance_name 

      The same applies to exclude filters.

      We didn't discuss the name of the common filter. It could be either "resource_id" (analogically to "account" filter for account/account-alias, but it is may be a little confusing in the case of resource_id/instance_name), or it could be more neutral, e.g., "instance" 

      Note: alternatively to this backend change, we could just add additional filter to the UI filter dropdown -> so instead of  "Instance", we could have "Resource_id" and "Instance_name" options there.

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

                Created:
                Updated:
                Resolved: