We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9dd9db8 + 1edcab2 commit 2a0c695Copy full SHA for 2a0c695
src/spaceone/cost_analysis/service/cost_service.py
@@ -315,19 +315,25 @@ def stat(self, params):
315
"""
316
317
domain_id = params["domain_id"]
318
+ data_source_id = params.get("data_source_id", "global")
319
query = params.get("query", {})
320
321
+ if data_source_id and data_source_id != "global":
322
+ query = self.cost_mgr.change_filter_v_workspace_id(
323
+ query, domain_id, data_source_id
324
+ )
325
+
326
if self._is_distinct_query(query):
327
page, query = self._get_page_from_query(query)
328
search, query = self._get_search_value_from_query(query)
329
query_hash = utils.dict_to_hash(query)
330
331
self.cost_mgr.create_cost_query_history(
- query, query_hash, domain_id, "global"
332
+ query, query_hash, domain_id, data_source_id
333
)
334
335
response = self.cost_mgr.stat_monthly_costs_with_cache(
336
337
338
339
if search:
0 commit comments