-
Story
-
Resolution: Done
-
Normal
-
None
-
None
-
None
-
5
-
False
-
None
-
False
-
COST-3875 - Cloud: Show individual VM cost
-
-
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.